Raju.allen Raju.allen - 1 year ago 89
HTML Question

how to give a href inside the button tag in html

i need to open two links when a button is clicked in the html page. I figured it as by calling onclick function and creating anchor tag using createElement in Javascript. But how to include another link?? Is there a way to give a href in button tag??

Answer Source

You can simply do that with javascript


And if you want to open one of that links in curren window you can replace window.open by this

window.location = url1;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download