Markedcheckbox

Add javascript to get the value of checkbox or select box

Add javascript to get the value of checkbox or select box

You can also use the below code to get all checked checkboxes values.

  1. <script>
  2. document.getElementById('btn').onclick = function()
  3. var markedCheckbox = document.querySelectorAll('input[type="checkbox"]:checked');
  4. for (var checkbox of markedCheckbox)
  5. document.body.append(checkbox.value + ' ');
  6. </script>

Update a Softaculous staging site with the latest live DB
What is softaculous staging? How do I make my staging site live? How do I make a softaculous staging site? How do I create a staging site in cPanel? W...
Setting custom cookies with time out in Wordpress
How do I set session timeout in WordPress? How do I create a custom cookie in WordPress? How do I view cookies in WordPress? How do I enable secure co...
Categories and posts structure
What are post categories? What is the difference between tags and categories? How many categories should a blog post have? How many types of categorie...