Introduction:-
Welcome to another JavaScript tutorial of mine..This will code will determine if the user pressed Ok or Cancel
Solution:-
This code goes in the <head> tags:-
And this as your body:-Code:<SCRIPT language="JavaScript"> function Confirm_Ok_Cancel() { var Ok_Cancel= confirm("Press Ok or Cancel!"); if (Ok_Cancel== true) { alert("You pressed Ok"); } else { alert("You Pressed Cancel"); } } </SCRIPT>
Explanation:-Code:<body onLoad="Confirm_Ok_Cancel()">
I think it's self explanatory no need of explanations!
A Preview:-
Conclusion:-
As Always Feedback is welcome and the full source is attached!!


LinkBack URL
About LinkBacks







Reply With Quote







Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum