Found 10483 Articles for Web Development

HTML DOM Object form Property

AmitDiwan
Updated on 25-Oct-2019 08:15:08

210 Views

The HTML DOM Object form property returns the reference of enclosing form for element.Following is the syntax −Returning reference to the form objectObjectElement.formLet us see an example of Object form property −Example Live Demo HTML DOM Object form    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Object-form                                            var divDisplay = document.getElementById("divDisplay");    var objSelect = document.getElementById("objSelect");    function getObjectForm() {       divDisplay.textContent = 'Location of above picture: '+objSelect.form.id;    } OutputBefore clicking ‘Get location of pic in website’ button −After checking ‘Get location of pic in website’ button −

HTML DOM Object data Property

AmitDiwan
Updated on 25-Oct-2019 08:12:24

125 Views

The HTML DOM Object data property returns a string corresponding to the value of the attribute data.Following is the syntax −Returning string valueObjectElement.dataSet data property to a string valueObjectElement.data = URLStringLet us see an example of HTML DOM Object data property −Example Live Demo HTML DOM Object data    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Object-data                                                          var divDisplay = document.getElementById("divDisplay");    var objSelect = document.getElementById("objSelect");    function getObjectData() {       objSelect.data       divDisplay.textContent = 'URL of above picture: '+objSelect.data;    } OutputBefore clicking ‘Get URL’ button −After clicking ‘Get URL’ button −

HTML DOM Nav Object

AmitDiwan
Updated on 25-Oct-2019 07:34:16

236 Views

The HTML DOM Nav Object in HTML represents a element.Let us see an example of HTML DOM Nav object −Example Live Demo HTML DOM Nav    * {       padding: 2px;       margin:5px;    }       form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Nav                         ... Read More

HTML DOM MouseEvent Object

AmitDiwan
Updated on 25-Oct-2019 07:20:32

419 Views

The HTML DOM MouseEvent Object represents an event which incurs on interaction of mouse with the HTML document elements.Here, “MouseEvent” can have the following properties and methods −Property/MethodDescriptionaltKeyItreturns whether the "ALT" key on keyboard was pressedwhen the mouse event was triggeredbuttonItreturns a number corresponding to which mouse button was pressedwhen the mouse event was triggeredbuttonsItreturns which mouse buttons were pressed when the mouse event wastriggeredclientXItreturns the horizontal (x) coordinate of the mouse pointer, relative to the current window, when the mouse event was triggeredclientYItreturns the vertical (y) coordinate of the mouse pointer, relativeto the current window, when the mouse event ... Read More

HTML DOM MouseEvent screenX Property

AmitDiwan
Updated on 24-Oct-2019 12:33:14

106 Views

The HTML DOM MouseEvent screenX property returns the horizontal (x) coordinate of the mouse pointer relative to the users screen display if a mouse event was triggered. Use with screenY to get the vertical coordinate as well.Following is the syntax −Returning reference to the screenX objectMouseEventObject.screenXLet us see an example of MouseEvent screenX property −Example Live Demo MouseEvent screenX    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {     ... Read More

HTML DOM MouseEvent relatedTarget

AmitDiwan
Updated on 24-Oct-2019 12:28:44

106 Views

The HTML DOM MouseEvent relatedTarget property returns the corresponding element that triggered the respective mouseover or mouseout event.Following is the syntax −Returning reference to the relatedTarget objectMouseEventObject.relatedTargetLet us see an example of MouseEvent relatedTarget property −Example Live Demo MouseEvent relatedTarget    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {       width:70%;       margin: 0 auto;       padding: 0;       text-align: center;   ... Read More

HTML DOM MouseEvent pageY Property

AmitDiwan
Updated on 24-Oct-2019 12:24:33

100 Views

The HTML DOM MouseEvent pageY property returns the vertical (y) coordinate of the mouse pointer relative to the document if a mouse event was triggered. Use with pageX to get the horizontal coordinate as well.Following is the syntax −Returning reference to the pageY objectMouseEventObject.pageYLet us see an example of MouseEvent pageY property −Example Live Demo MouseEvent pageY    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {       width:70%; ... Read More

HTML DOM MouseEvent pageX Property

AmitDiwan
Updated on 24-Oct-2019 12:10:10

107 Views

The HTML DOM MouseEvent pageX property returns the horizontal (x) coordinate of the mouse pointer relative to the document if a mouse event was triggered. Use with pageY to get the vertical coordinate as well.Following is the syntax −Returning reference to the pageX objectMouseEventObject.pageXLet us see an example of MouseEvent pageX property −Example Live Demo MouseEvent pageX    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {       width:70%; ... Read More

HTML DOM MouseEvent offsetY Property

AmitDiwan
Updated on 24-Oct-2019 12:03:43

100 Views

The HTML DOM MouseEvent offsetY property returns the vertical (y) coordinate of the mouse pointer relative to the target element if a mouse event was triggered. Use with offsetX to get the horizontal coordinate as well.Following is the syntax −Returning reference to the offsetY objectMouseEventObject.offsetYLet us see an example of MouseEvent offsetY property −Example Live Demo MouseEvent offsetY    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {       ... Read More

HTML DOM MouseEvent offsetX Property

AmitDiwan
Updated on 23-Jun-2020 11:35:15

630 Views

The HTML DO MouseEvent offsetX property returns the horizontal (x) coordinate of the mouse pointer relative to the target element if a mouse event was triggered. Use with offsetY to get the vertical coordinate as well.Following is the syntax −Returning reference to the offsetX objectMouseEventObject.offsetXLet us see an example of MouseEvent offsetX property −Example Live Demo MouseEvent offsetX    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {       width:70%;   ... Read More

Advertisements