scriptygoddess

25 Jan, 2008

Have button (input element) go to new page with onclick

Posted by: Jennifer In: Javascript

This is probably considered "Javascript 101" – but I still had a bit of trouble finding just the right syntax to work. Simply needed a button to open a new page (in the same browser window):

<input type="button" value="THERE REALLY ARE OTHER SEARCH ENGINES!"
onclick="location.href='http://www.yahoo.com'; return false" />

Related posts:

  1. Striping IMG tags from the_content in WordPress (and how to fudge page excerpts) Background: For a site I was working on, I was...

Related posts brought to you by Yet Another Related Posts Plugin.

No Responses to "Have button (input element) go to new page with onclick"

Comment Form

Featured Sponsors

About


Advertisements