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

pnoeric used Ask the Experts™
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.

<a href=''>
   <button type='button' alt='go to Yahoo'>go to Yahoo</button>


Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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='';">go to Yahoo</button>

Open in new window


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.)


(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!

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 in place of window.location
<button type='button' alt='go to Yahoo' onClick="'');">go to Yahoo</button>

Open in new window


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:

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



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