HTML DOM ononline Event Last Updated : 15 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM ononline event occurs on the online work of the browser. The ononline event is a conflict with the onoffline event. Note: navigator.onLine property is used to check the mode of the browser. Supported Tags <body> Syntax: In HTML: <element ononline="myScript">In JavaScript: object.ononline = function(){myScript};In JavaScript, using the addEventListener() method: object.addEventListener("online", myScript); Example: Using the addEventListener() method HTML <!DOCTYPE html> <html> <head> <title> HTML DOM ononline Event </title> </head> <body> <h1> GeeksforGeeks </h1> <h2> HTML DOM ononline Event </h2> <script> window.addEventListener("online", onlineGFG); window.addEventListener("offline", offlineGFG); function onlineGFG() { alert("Online"); } function offlineGFG() { alert("Offline"); } </script> </body> </html> Output: Supported Browsers: The browsers supported by HTML DOM ononline Event are listed below: Firefox 3.0 Comment More infoAdvertise with us Next Article HTML DOM ononline Event V Vijay Sirra Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM onoffline Event The DOM onoffline event occurs on offline work of the browser. The onoffline event is a conflict with the ononline event. Note: navigator.onLine property is used to check the mode of the browser. Supported Tags: <body> Syntax: In HTML: <element onoffline="myScript">In JavaScript: object. 1 min read HTML | DOM ontoggle Event The ontoggle event in HTML DOM occurs when the <details> element user opens or closes by the user. The <details> tag is used for the content/information which is initially hidden but could be displayed if the user wishes to see it. Supported tags <details> Syntax: In HTML: <elem 1 min read HTML DOM onopen Event The DOM onopen event occurs on an open connection with an event source. Related events: onmessage: Received the message.onerror: The problem occurs. Syntax: Using JavaScript:object.onopen = function(){myScript};Using the addEventListener() method:object.addEventListener("open", myScript); Example: U 1 min read HTML DOM oninvalid Event The HTML DOM oninvalid event occurs when we submit an invalid element. For example, if an input field is submittable and the required attribute is set then it's invalid if the field is empty. Syntax: In HTML:<element oninvalid="myScript">In JavaScript:object.oninvalid = function(){myScript};In 2 min read HTML DOM onclick Event The HTML DOM onclick event occurs when the user clicks on an element. In HTML:<element onclick="myScript">HTML<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Click me</button> <p id="gfg"></p> <script> function myFunction() { documen 1 min read Like