I have a list with several checkboxes dynamically generated by php inside a div, so they do not have an id or a name.
I can read the full div content with
var list = document.getElementById("myList").innerHTML;
the variable list looks similar to this:
<li><input type="checkbox">text 1</li>
<li><input type="checkbox">text 2</li>
<li><input type="checkbox">text 3</li>
<li><input type="checkbox">text 4</li>
.... (unknown number of entries)
What I need to do is to check if the checkbox has been checked or not prior to sending the data to a php file.
I would like to have something similar to this
<li>(checked) text 1</li>
<li>(not checked) text 2</li>
<li>(checked) text 3</li>
<li>(checked) text 4</li>
How can I do this ?