window.alert():-
- एक डायलॉग बॉक्स (pop-up) में संदेश दिखाता है जिसमें एक OK बटन होता है।
- इसका उपयोग आमतौर पर साधारण सूचनाओं या डिबगिंग (testing) के लिए किया जाता है।
- उपयोगकर्ता को अलर्ट बॉक्स बंद करने के लिए "OK" पर क्लिक करना होता है।
- उदाहरण:
window.alert("नमस्ते दुनिया!"); या सीधे alert("नमस्ते!");
SYNTAX:-
<!DOCTYPE html>
<html>
<body>
<script>
window.alert("Hello! This is an alert box.");
</script>
</body>
</html>
window.alert() :
- Displays a message in a dialog box (pop-up) that contains an OK button.
- It is commonly used for simple notifications or debugging (testing).
- The user must click "OK" to close the alert box.
- Example:
window.alert("Hello world!"); or simply alert("Hello!");
SYNTAX:-
<!DOCTYPE html>
<html>
<body>
<script>
window.alert("Hello! This is an alert box.");
</script>
</body>
</html>