Alert in javascript

What you will learn here about javascript

  • alert in javascript

alert or pop up in javascript is display by using alert() method or function. alert method is the method of windows object. window object is global object. so we can access alert() method by two ways

  1. window.alert() //using window object
  2. alert() //without window object

Example of window.alert()

<script>
window.alert(“This is example of window.alert”);
</script>


Example of alert()

<script>
alert(“This is example of alert”);
</script>

You may also like...