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>

Remove /category/ from category (archive) page URLs (without using a plugin)
How do I remove category names from URL? How do I remove category categories from WordPress URL? How do I remove a product category base? How do I rem...
Manage roles and capabilities without loads of code
How do I manage roles in WordPress? How do you add capability in user role editor? What do the different WordPress roles mean? How do I add user roles...
How to get all post categories without custom post type categories?
How can I get custom post type category? How do I display custom post type categories in WordPress? How do I remove custom post type? How do I find th...