जावास्क्रिप्ट फ़ंक्शन को अलर्ट बॉक्स में कॉल करने के लिए, आप निम्न कोड चलाने का प्रयास कर सकते हैं -
उदाहरण
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction(warning) {
alert(warning);
catchedAlert();
}
function catchedAlert() {
alert('Alert called!');
}
</script>
<button onclick="myFunction('This is an alert box!')">Click me!</button>
</body>
</html>