HTML | DOM touchstart Event Last Updated : 10 Jun, 2022 Comments Improve Suggest changes Like Article Like Report The touchstart event is used to execute a script whenever the user touches an HTML element. On touching a particular element, if the touchstart event is associated with it, it can be used to trigger a javascript function. Note: The touchstart event works only on touch screen devices.Supported Tags All HTML element supported this event. Syntax : object.ontouchstart = myScript; Below program illustrates the touchstart event :Program: Executing a JavaScript when a user touches a P element. html <!DOCTYPE html> <html> <head> <title>touchstart event in HTML</title> <style> h1 { color:green; } h2 { font-family: Impact; } body { text-align:center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>touchstart event</h2><br> <!-- On touching this P element, the start() function is triggered --> <p ontouchstart="start()"> Touch somewhere in the paragraph to trigger a function. </p> <br> <p id="test"></p> <script> function start() { document.getElementById("test").innerHTML = "Paragraph has been touched"; } </script> </body> </html> Output: After touching the screen Supported Web Browsers: Google Chrome 22 and aboveEdge 12 and aboveFirefox 52 and above Comment More infoAdvertise with us S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Style height Property HTML DOM Style height Property is similar to CSS Height Property but it is used to set or get height of an element dynamically. Syntax : To set the height property : object.style.height = auto|length|%|initial|inherit;To get height property value: object.style.height Property Values: ValueDescriptio 2 min read HTML DOM Base Object The Base Object in HTML DOM is used to represent the HTML <base> element. This tag is used to set or get the properties of <base> element. This element can be accessed by using getElementById() method. Syntax: document.getElementById("Base_ID"); This "Base_ID" is assigned to HTML <bas 2 min read HTML | DOM Meta Object The DOM Meta Object is used to represent the HTML <meta> element. The Meta element is accessed by getElementById().Properties: Name attribute: This attribute is used to define the name of property.http-equiv attribute: This attribute is used to get http response message header.Scheme attribute 2 min read HTML | DOM TouchEvent altKey Property The TouchEvent altKey property is a read-only property and used for returning a Boolean value which indicates whether or not the "ALT" key was pressed when a touch event was triggered. The TouchEvent altKey property mostly returns false because generally, touch devices do not have an alt key. Syntax 2 min read HTML | DOM MouseEvent screenY Property The MouseEvent screenY property is a read-only property and used for returning the vertical coordinate of the mouse pointer when an event was triggered. Syntax : event.screenY Return Value: It returns a number which represents the vertical coordinate of the mouse pointer in pixels. Below program ill 1 min read HTML | DOM touchcancel Event The touchcancel event is used to execute a script when the touch event gets interrupted. It is considered a good practice to include the touchcancel event to clean up the code if the devices interrupt a touch event at different actions.Supported Tags All HTML elements supported by this event. Suppor 1 min read HTML DOM childNodes Property The childNodes property returns a node's child nodes as a nodeList object. White spaces and comments are also considered as nodes. The nodes are assigned index numbers, starting from 0. Searching and sorting operations can be performed using index number on the node list. Syntax: elementNodeReferenc 2 min read HTML DOM MouseEvent pageX Property The MouseEvent.pageX property returns the horizontal coordinate (in pixels) of the mouse pointer, relative to the entire document (not just the viewport), when a mouse event occurs. This value includes any horizontal scrolling that has been doneSyntax: event.pageXReturn Values: It returns the horizo 1 min read HTML | DOM MouseEvent offsetY Property The MouseEvent offsetY property is a read-only property and is used for returning the y-coordinate of the mouse pointer, relative to the target element. The MouseEvent offsetY property returns a number which represents the vertical coordinate of the mouse pointer, in pixels with respect to the scree 1 min read HTML | DOM TouchEvent ctrlKey Property The TouchEvent ctrlKey property is a read-only property and used for returning a Boolean value which indicates whether or not the "CTRL" key was pressed when a touch event was triggered. It mostly returns false because generally, touch devices do not have a ctrl key. Syntax : event.ctrlKey Return Va 2 min read Like