Get checkbox is checked or not using Javascript -


i've got problem can't solve. partly because can't explain right terms. i'm new sorry clumsy question.

below can see overview of goal.

i'm running code in magento

<input type="checkbox" style="margin-left:24px" class="mydelete" name="checkall" onclick='checkedall(testcheck);' /> 

added id attribute element.

<input type="checkbox" style="margin-left:24px" class="mydelete" name="checkall" id="checkall"onclick='checkedall();' /> 

javascript

function checkedall(){     if (document.getelementbyid('checkall').checked) {         alert("checked");     } else {         alert("you didn't check it! let me check you.")     } } 

demo


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

tsql - Pivot with Temp Table (definition for column must include data type) -- SQL Server 2008 -