Answers for "JS select all fucnction"

2

select all checkboxes html js

<script language="JavaScript">
function toggle(source) {
  checkboxes = document.getElementsByName('foo');
  for(var i=0, n=checkboxes.length;i<n;i++) {
    checkboxes[i].checked = source.checked;
  }
}
</script>

<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>

<input type="checkbox" name="foo" value="bar1"> Bar 1<br/>
<input type="checkbox" name="foo" value="bar2"> Bar 2<br/>
<input type="checkbox" name="foo" value="bar3"> Bar 3<br/>
<input type="checkbox" name="foo" value="bar4"> Bar 4<br/>
Posted by: Guest on November-13-2020
0

js select all

// This will select all of the text in the textarea or input called element
element.select();
Posted by: Guest on December-04-2020

Code answers related to "JS select all fucnction"

Code answers related to "Javascript"

Browse Popular Code Answers by Language