<html> <head> </head> <body> <select id="s"></select> <script> opts=[1,2,3,5] opts.forEach(function(x){s.appendChild(new Option(x))}) </script> </body> </html>