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>

How can I show subpages dropdown upon select on parent page to any page
How do I show a list of child pages in a parent page in WordPress? How do I show subpages in WordPress? How do parent pages work in WordPress? How do ...
Secure WordPress API, how?
How to Secure the REST API Disable REST API — Disable REST completely for all non-logged users. REST API Toolbox — Disable only the REST users endpoin...
Creating post template for a Custom Post Type
Can I assign a template to a custom post type? How do I create a custom post type template in WordPress? How do I create a custom post type archive pa...