Javascript examples for DOM:Element setAttribute
set select box size attribute
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w . j a v a 2s .c o m var o_select = document.getElementById("mySelect"); o_select.size = "10"; } </script> </head> <body> <select class="styled" id="mySelect"> <option>This is an option</option> <option>This is another option</option> </select> </body> </html>