mp3 guru

Alle Checkboxen markieren HTML & Javascript

Alle Checkboxen markieren HTML & Javascript

<script type="text/javascript">
<!--
function check(checked)
{
  for (var i = 2; i < document.forms[0].elements.length; i++) {
    document.forms[0].elements[i].checked = checked;
  }
}
 
//-->
</script>
<form method="post" action="">
<p><input type="radio" name="checkall" onclick="check(true)" /> check all <input type="radio" name="checkall" onclick="check(false)" /> uncheck all</p>
<ul>
<li><input type="checkbox" name="textN[]" value="Text-1" />Text-1</li>
<li><input type="checkbox" name="textN[]" value="Text-2" />Text-2</li>
</ul>
</form>

Checkbox, HTML, Javascript, markieren


Schreibe einen Kommentar