<html><head><script language="JavaScript" type="text/javascript"><!--// Define the setFocus function called by pressing the button.function setFocus(num){ // Determine which button was clicked and set the cursor // in the appropriate select box. if(num == 1){ document.myForm.mySelect1.focus(); }else if(num == 2){ document.myForm.mySelect2.focus(); }}// --></script></head><body><p><form name="myForm"> <select name="mySelect1" multiple> <option value="BASE">Baseball</option> <option value="FOOT">Football</option> <option value="BASKET">Basketball</option> <option value="SOCCER">Soccer</option>
</select> <input type="button" value="Click to Set Cursor" name="myButton1" ...
Get Pure JavaScript, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.