<!DOCTYPE html> <html> <body onload='var elem1 = document.getElementById("one"); elem1.setAttribute("selected", "selected");'> <select> <option id="one" disabled>Option one</option> <option id="two" selected>Option two</option> </select> </body> </html>