0
How to use warning command?
Can anybody tell me how to use the warning command in HTML JavaScript
2 Réponses
+ 5
<html>
<head>
<script type="text/javascript">
<!--
function getValue(){
var retVal = prompt("Enter your name : ", "your name here");
document.write("You have entered : " + retVal); }
//-->
</script>
</head>
<body>
<p>Click the following button to see the result: </p>
<form>
<input type="button" value="Click Me" onclick="getValue();" />
</form>
</body>
</html>
+ 4
Thanks to @Mohit, I guess you're talking about pop up boxes?
There are three type:
> alert() to just show a message to user, waiting for validation (only one buttons: ok)
> confirm() to display a message and get a boolean user response (two buttons: ok/cancel)
> prompt() wich display a message and expect a value (string) from user (two buttons: ok/cancel)
https://www.w3schools.com/js/js_popup.asp