Javascript Example: Visit URL In A New Window

Type a domain name in the following field then press Enter. Then, the browser will visit that url in a new window.

Goto site:

The code looks like this:

function f() {
 var ss = document.getElementById("xx").value;
 open( "http://" + ss );
}
<form action="" onSubmit="f(); return false;">
<p>Goto site: <input id="xx" type="text" size="40" value="xahlee.org"></p>
</form>
Home
Terms of Use
About
Advertise
Subscribe
Google
2005-06
© 2005 by Xah Lee.