<html>
<body>
Homepage: <input type="url" id="myURL" value="http://www.google.com">
<p>Click the buttons below to give focus and/or remove focus from the URL field.</p>
<button type="button" onclick="getFocus()">Get focus</button>
<button type="button" onclick="loseFocus()">Lose focus</button>
<script>
function getFocus() {
document.getElementById("myURL").focus();
}
function loseFocus() {
document.getElementById("myURL").blur();
}
</script>
</body>
</html>