Execute Script When User Navigates Away from Page in HTML

Nishtha Thakur
Updated on 03-Mar-2020 07:37:07

284 Views

When the user navigates from a page, the onpagehide attribute triggers. The navigation occurs when a user clicks a link, closes the browser tab, submits a form, etc.To execute it, try −You can also use,object.onpagehide = function(){script};

Execute a Script When the Browser Starts Online in HTML

Smita Kapse
Updated on 03-Mar-2020 07:36:24

146 Views

When the web browser starts to work online, the ononline attribute triggers. You can try to run the following code to implement ononline attribute −Example                    function onlineFunc() {             alert ("Working online!");          }          function offlineFunc() {             alert ("Workinf offline!");          }             Got o the web browser menu bar and click the File menu. Select       "Work Offline" and toggle between online and offline.    

Execute Script When Browser Works Offline in HTML

seetha
Updated on 03-Mar-2020 07:31:19

238 Views

When the web browser starts to work offline, the onoffline attribute triggers. You can try to run the following code to implement onoffline attribute −Example                    function onlineFunc() {             alert ("Working online!");          }          function offlineFunc() {             alert ("Workinf offline!");          }             Got o the web browser menu bar and click the File menu. Select "Work Offline" and toggle between online and offline.    

Execute a Script When Mouse Pointer Moves Out of an Element in HTML

Sravani S
Updated on 03-Mar-2020 07:29:53

153 Views

When the mouse pointer moves out of an element, the onmouseout attribute triggers. You can try the following code to implement onmouseout attribute −Example                    This is demo heading.             Click above and then release.                function mouseOut() {             document.getElementById("myid").style.color = "red";          }          

Execute Script While Mouse Pointer is Over an Element in HTML

Ankith Reddy
Updated on 03-Mar-2020 07:29:12

161 Views

When the mouse pointer is moving over an element, the onmousemove attribute triggers. You can try to the following code to implement onmousemove attribute −Example                    This is demo heading.            Click above and then release.               function mouseMove() {         document.getElementById("myid").style.color = "red";         }          

Include Input Field in HTML

vanithasree
Updated on 03-Mar-2020 07:24:01

411 Views

The HTML tag is used within a form to declare an input element - a control that allows the user to input data.The following are the attributes −AttributeValueDescriptionacceptcontent typesSpecifies a comma-separated list of content types that the server acceptsalignleftrighttopmiddlebottomDeprecated − Defines the alignment of contentaltTextThis specifies text to be used in case the browser/user agent can't render the input controlautocomplete onoffSpecifies for enabling or disabling of autocomplete in elementautofocus Autofocusspecifies that element should automatically get focus when the page loadscheckedCheckedIf type = "radio" or type = "checkbox" it will already be selected when the page loads.disabledDisabledDisables the input control. ... Read More

Create a Sub-Window in HTML

George John
Updated on 03-Mar-2020 07:13:49

1K+ Views

Use the tag to create a sub window. The HTML tag is used to specify each frame within a frameset tag.Note − This tag is not supported in HTML5. Do not use.The following are the attributes −AttributeValueDescriptionFrameborder0 or 1Specifies whether or not to display border around the frame.MarginheightpixelsAllows you to specify the width of the space between the left and right of the frame's borders and the frame's content. The value is given in pixels. For example marginwidth = "10".MarginwidthpixelsSpecifies the margin, in pixels, between the frame's contents and it's left and right margins.Nameframe nameName of the frame.NoresizenoresizeWhen ... Read More

Create a Footer for a Document or Section in HTML5

Jennifer Nicholas
Updated on 03-Mar-2020 07:06:18

344 Views

Use the HTML tag to display a footer for a document or section. You can try to run the following code to implement tag −Example           HTML Footer Tag                        Simply Easy Learning          You're visiting tutorialspoint.com - tutorial hub for simply easy learning.                      © Copyright 2018, All Rights Reserved          

Define Start of a Term in Definition List in HTML

Nikitha N
Updated on 03-Mar-2020 07:05:35

270 Views

The HTML tag is used to define the start of a term in a definition list. A definition list is similar to other lists but in a definition list, each list item contains two entries; a term and a description.ExampleYou can try to run the following code to define the start of a term in a definition list using the tag −           HTML dt Tag                        Definition List          A list of terms and their definitions/descriptions.          JAVA          Tutorial on JAVA Programming Language.          Android          Tutorial on Android Operating System.          

Execute Script on Mouse Button Release in HTML

radhakrishna
Updated on 03-Mar-2020 07:04:51

257 Views

When the mouse button is released over an element, the onmouseup event triggers. You can try to run the following code to implement onmouseup attribute −Example                    This is demo heading.             Click above and then release.                function mouseDown() {             document.getElementById("myid").style.color = "yellow";          }          function mouseUp() {             document.getElementById("myid").style.color = "blue";          }          

Advertisements