Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dom check a checkbox

document.getElementById("myCheck").checked = true;
Comment

javascript check item is checkbox

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript Checkbox</title>
</head>
<body>
    <label for="accept">
        <input type="checkbox" id="accept" name="accept" value="yes"> Accept
    </label>

    <script>
        const cb = document.querySelector('#accept');
        console.log(cb.checked); // false
    </script>

</body>

</html>
Code language: HTML, XML (xml)
Comment

PREVIOUS NEXT
Code Example
Javascript :: last element array 
Javascript :: querySelectorAll checked js 
Javascript :: object get property with max value javascript 
Javascript :: find array object value is already in use 
Javascript :: jquery on scroll down 
Javascript :: deploy create react app pm2 
Javascript :: electron app to exe 
Javascript :: json parse stringified array 
Javascript :: make created element brighter 
Javascript :: regular expression should not contain special character 
Javascript :: next js update 
Javascript :: React setup for handling UI. 
Javascript :: nodejs redis json count object keys 
Javascript :: javascript dom last child 
Javascript :: create element javascript with class 
Javascript :: header in axios 
Javascript :: remove all chars from string and leave only numbers javascript 
Javascript :: js arrays check if there is intersection 
Javascript :: keyup addeventlistener 
Javascript :: mongoose pull each 
Javascript :: odoo popup input not taking keyboard value 
Javascript :: js random int 
Javascript :: enable network request in react native 
Javascript :: javascript change data attribute value 
Javascript :: delete all node module 
Javascript :: easyui datagrid double click cell 
Javascript :: scroll to bottom of an element 
Javascript :: javascript leap year 
Javascript :: regular expression number from 1 to 100 
Javascript :: does json only support ascii 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =