<html> <body onload="document.getElementById('i').select();"> <input id="i" value="text"> </body> </html>