Jump to content

I want to put a link inside of an alert box


goddess

Recommended Posts

I want to put a link on an alert button. <html><head><script type="text/javascript">function disp_alert(){alert("I am an alert box!!");}</script></head><body><input type="button" onclick="disp_alert()" value="Display alert box" /></body></html>Where value reads "would you like to continue..." and alert reads "click ok to continue" to its' link.Please help.Thanks Diane Milinowski :)

Link to comment
Share on other sites

You can't put a link inside of an alert box, an alert box just displays some text and has an OK button. You can have a confirm box that shows text and has OK and Cancel buttons, or a prompt box where someone can type something in. You can't put HTML code into the alert text though, it will just display as HTML code.

Link to comment
Share on other sites

I think he means make the ok button redirect to a page, i.e.

<html><head><script type="text/javascript">function disp_alert(){if (confirm("click ok to continue")) window.location = "link.html";}</script></head><body><input type="button" onclick="disp_alert()" value="would you like to continue?" /></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...