Found 2202 Articles for HTML

Execute a script when the browser window is closed in HTML?

Prabhas
Updated on 03-Mar-2020 07:38:46

722 Views

The unloaded attribute triggers when you close the web browser window. You can try to run the following code to implement unloaded attribute in HTML −Example           Tutorialspoint       Simply Easy learning                function display() {             alert("Bye!");          }          

Execute a script when a user navigates away from a page in HTML?

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

257 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 to work offline in HTML?

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

217 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 as long as the mouse pointer is moving over an element in HTML?

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

146 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";         }          

Execute a script when the browser starts to work online in HTML?

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

126 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 a script when a mouse pointer moves out of an element in HTML?

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

135 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 a script when a mouse wheel is being scrolled over an element in HTML?

Nikitha N
Updated on 30-May-2020 22:58:31

347 Views

When a mouse wheel is being scrolled over an element, the onwheel attribute triggers.ExampleYou can try to run the following code to execute a script when a mouse wheel is being scrolled over an element in HTML −                   This is demo text. Roll the mouse wheel here.                function display() {             alert("Mouse Wheel used!");          }          

How do we add a single-line input field in HTML?

Anvi Jain
Updated on 30-May-2020 22:59:17

690 Views

Use the tag to add a single-line input field. The HTML tag is used for querying a document through a text field. The tag can be used anywhere but head tag is preferable. Note: It is a deprecated tag and should not be used.The following are the attributes −AttributeValueDescriptionPromptstringLabel for the text fieldActionURLused when a query needs to be sent to a different URLExampleTry the following code −           HTML isindex Tag          

How to add a set of frames in HTML?

Priya Pallavi
Updated on 24-Jun-2020 08:57:21

449 Views

Use the tag to add a set of frames. The HTML tag is used to divide the window into frames. Note − This tag is not supported in HTML5. Do not use.The following are the attributes −AttributeValueDescriptionColscolumn sizeSpecifies the number of columns and their width in either pixels, percentages, or relative lengths. Default is 100%Rowsrow sizeSpecifies the number of rows and their height in either pixels, percentages, or relative lengths. Default is 100%.ExampleYou can try to run the following code to add a set of frames using the tag −           HTML frameset Tag                                                 Your browser does not support frames.                    

How to include an input field in HTML?

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

381 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

Advertisements