views:

54

answers:

1
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.2/mootools-yui-compressed.js"&gt;&lt;/script&gt;

 <script type="text/javascript" src="sexyalertbox.v1.2.moo.js"></script>

 <link rel="stylesheet" type="text/css" media="all" href="sexyalertbox.css"/>

<body>

        <p><a href="#" onclick="Sexy.alert('<h1>hello</h1><p>Please enter a valid email address</p>');return false;">Click here</a></p>





</body>

</html>

When we click on click here then a alert box will appear. I want to have that alert box in javascript ie

   alert("Same sexy alert box type alert box");  // hwo to do this??
+1  A: 

Just add this after the script:

Window.prototype.alert = function(message){
    Sexy.alert(message);
};

Btw. Never use onclicks in your HTML. Use Event Handlers in your JS file.

Here's a working test-case: http://jsfiddle.net/bRjcG/3/

Oskar Krawczyk