html tutorial - ononline Attribute in HTML - html5 - html code - html form




ononline attribute in html

Learn html - html tutorial - ononline attribute in html - html examples - html programs

  • The ononline attribute triggers when the browser starts work online.

Syntax for ononline attribute in HTML:

<element ononline="script">

Difference between HTML 4.01 and HTML 5 for ononline Attribute:

HTML 4.01

  • HTML 4 does not support ononline attribute.

HTML 5

  • HTML 5 supports ononline attribute.

Applies To:

Element Attribute
<body> ononline

ononline Attribute Value:

Value Description
script The script to be run on ononline

Sample Coding for ononline Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy ononline attribute</title>
    </head>
    <body ononline="online()">
    <h2>Goto file menu and click “Work Offline”</h2>
        <p>
            Learn to Code in Wikitechy<br>  
            Teach people how different technologies are organized<br> 
        <b>Note:</b>ononline only supported in Firefox and
        Internet Explorer version 8 to 10.</p>
        <script>
          function online()
          {
            alert ("You are working in online.");
          }                  
        </script>
    </body>
</html>

Code Explanation for ononline Attribute in HTML:

ononline Attribute Code Explanation

  1. ononline attribute used to trigger an event when the browser starts working in online.
  2. online JavaScript function used to show an alert message “You are working in online.”

Output for ononline Attribute in HTML:

ononline Attribute Output

  1. Goto File menu in the browser and chose “Work Offline”, select the same to toggle between working online and offline.
  2. ononline Attribute Output
  3. The Window shows an alert message “You are working in online.”

Browser Support for ononline Attribute in HTML:

No 8.0-10.0 3.0 No No

Tips and Notes

  • ononline only supported in Firefox and Internet Explorer version 8 to 10.

Related Searches to online attribute in html