Stupid IE won't let my link a <button> --??

pnoeric
pnoeric used Ask the Experts™
on
Grr. Firefox, Safari and Chrome all do fine with this code; click the button and go to Yahoo. IE just sits there like an idiot.

Is there any way to make this work? My site has all these fantastic CSS-styled buttons that I want to use like this... it's all flawless. Except for stupid IE.
<html><body>

<a href='http://yahoo.com'>
   <button type='button' alt='go to Yahoo'>go to Yahoo</button>
</a>

</body></html>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
You can use the onClick event to change the window.location.  This will work in IE.
<button type='button' alt='go to Yahoo' onClick="javascript:window.location='http://yahoo.com';">go to Yahoo</button>

Open in new window

Author

Commented:
So there's no way to get my code that I posted to work? (I'd prefer to not use onclick, for other reasons, if possible.)

Author

Commented:
(For example: I can't add "target='_new'" to a <button> tag...)
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
I do not believe there is a way to make you code work in IE.  You can open the page in a new window using window.open in place of window.location
<button type='button' alt='go to Yahoo' onClick="javascript:window.open('http://yahoo.com');">go to Yahoo</button>

Open in new window

Hi,

IE does not like the button tag so the code you posted will not work in IE.  You have a few options.  

1.  You can use the JavaScript that jrtwig posted above

2.  Use CSS to create something that looks like a button.  See the accepted solution here: http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Postfix/Q_24110883.html

3.  Use a server side language like php to redirect on submit.

Thanks,

John

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial