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" />

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

Comments are closed.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements