Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Button as a link - 2 methods


// JavaScript URL
< input type = button value = "My Place" onClick = "window.location=' http://www.garybeene.com '" >


// onClick calls a function to set window.location
< script >
function goToURL() { window.location = " http://www.myplace.50g.com " ; }
</ script >

< input type = button value = "My Place" onClick = "goToURL()" >