A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-ononline-event-attribute/ below:

HTML | ononline Event Attribute

HTML | ononline Event Attribute

Last Updated : 16 Aug, 2022

The ononline event attribute works when the browser starts working in online mode. it is opposite to onoffline event attribute.
Supported Tags 

syntax 
 

<element ononline = "script">


Attribute Value: This event attribute contains single value script which works when browser working in online mode.
Example: 
 

html
<!DOCTYPE HTML>
<html>
    <head>
        <title>
            ononline Event Attribute
        </title>
        
        <script>
            function onfunction() {
                alert("Browser is online");
            }
            function offunction() {
                alert("browser is offline");
            }
        </script>
    </head>

    <!-- ononline event used here -->
    <body ononline = "onfunction()"
        onoffline = "offunction()">
    </body>
</html>                            

Output: 
 


Supported Browser: 



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4