Getting value of HTML Checkbox from onclick/onchange events

 

<html><head>
</head>
<body>
  <div style="display: none;" id="container">Check Box is Checked</div>
<br><br>
<label>
    <input id="mycheckbox" onclick="myChange()" type="checkbox">
   
</label>
<script>
    function myChange(){
    var temp = document.getElementById('mycheckbox');
    document.getElementById('container').style.display = temp.checked ? 'block' : 'none';
};
    </script>
</body></html>

Comments

Popular posts from this blog

Script For Login, Logout and View Using PHP, MySQL and Bootstrap

PHP Ajax Login Validation Tutorial

Insert CheckBox and Radio button Data in MySQL Database Using PHP