HTML DOM UiEvent Last Updated : 14 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The DOM UiEvent in HTML is an event that is triggered by the user interface belonging to the UiEvent Object. The two main purposes of the UI Event are: Allows registration of event listeners and describes event flow through a tree structure.Provide a common subset of the current event systems used in existing browsers. Syntax: Event_name = function Return Value: This will return the object with the specified Event attached. The event types belonging to the UiEvent Object are: EventfunctionabortThis event occurs when the loading of a media is aborted.beforeunloadThis event occurs before the document is about to be unloadederrorThis event occurs when an error occurred during the loading of a media file.loadThis event occurs when an object has loaded.resizeThis event occurs when the document view is resized.scrollThis event occurs when an element's scrollbar is being scrolled.selectThis event occurs after the user selects some text for("input" and "textarea").unloadThis event occurs once a page has unloaded (for "body"). Example 1: This example is based on "onresize" event. HTML <!DOCTYPE html> <html> <style> body { width: 90%; color: green; border: 2px solid green; height: 40%; font-weight: bold; text-align: center; padding: 30px; font-size: 20px; } #demo { color: black; } </style> <!-- 'onresize' event --> <body onresize="mainFunction()"> <p>Welcome to GeeksforGeeks!</p> <p>Try to resize the browser window to display the windows height and width.</p> <p id="demo"></p> <script> function mainFunction() { let w = window.outerWidth; let h = window.outerHeight; let txt = "width of window = " + w + ", Height of window = " + h; document.getElementById("demo").innerHTML = txt; } </script> </body> </html> Output: Example 2: This example is based on the "load" event. HTML <!DOCTYPE html> <html> <style> body { width: 90%; color: green; border: 2px solid green; height: 40%; font-weight: bold; text-align: center; padding: 30px; font-size: 20px; } #demo { color: black; } </style> <!-- 'onload' event. --> <body onload="myFunction()"> <p>Welcome to GeeksforGeeks!</p> <p>This page loaded.</p> <script> function myFunction() { alert("Page is loaded"); } </script> </body> </html> Output: Supported Browsers: Google Chrome 1Mozilla Firefox 1Internet Explorer 9Edge 12Safari 1Opera 12.1 Comment More infoAdvertise with us Next Article HTML DOM Samp Object K kundankumarjha Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM Style minHeight Property The minHeight property in HTML DOM is used to set or return the minimum height of an element. This property affects only on block-level elements, absolute or fixed position elements. Syntax: It returns the minHeight property.object.style.minHeightIt is used to set the minHeight Property.object.style 2 min read HTML | DOM Style counterReset Property The Style counterReset property in HTML DOM is used to create or reset counters. This property is used with the counterincrement property and the content property.Syntax: It is used to return the counterReset property. object.style.counterResetIt is used to set the counterReset property. object.styl 1 min read HTML | DOM Style borderWidth Property The borderWidth property in HTML DOM is used to set or return the width of the border element. Syntax: It is used to set the border of width. object.style.borderWidth = valueIt returns the border width property. object.style.borderWidth Return Value: It returns the selected border element with the g 4 min read HTML | DOM Style justifyContent Property The style justifyContent property in HTML DOM is used to align the items horizontally when they are not able to use all the available space. It is used to set the position of the element. By default, the items are positioned at the beginning of the container. Syntax: It returns the justifyContent pr 3 min read HTML DOM Samp Object The Samp Object in HTML DOM is used to represent the <samp> element. The <samp> element can be accessed by using the getElementById() method. Syntax: document.getElementById("ID"); Where ID is assigned to the <samp> tag. Example 1: In this example, we will use the DOM Samp Object. 1 min read HTML DOM OptionGroup Object The HTML DOM OptionGroup object represents the <optgroup> element, used to group related options within a dropdown list (<select>). It helps organize options with a label for better user experience in forms. Property Values: This object contains two property values which are listed below 2 min read HTML DOM execCommand() Method The DOM execCommand() method in HTML DOM is used to execute a command specified by the user on the editable selected section. Syntax:document.execCommand( command, showUI, value )Parameters: This method accepts three parameters which are listed below:command: This parameter hold the name of command 3 min read HTML | DOM Style left Property The Style left property is used for setting or returning the left position of a positioned element. The Style left property is used for specifying the left position of the elements including padding, scrollbar, border, and margin. Syntax : To get the property:object.style.leftTo set the propertyobje 2 min read HTML | DOM Quote Object The Quote Object in HTML DOM is used to represent the HTML <q> element. The quote element can be accessed by using getElementById() method.Property Value: It contains single attribute value cite. This attribute is used to set or return the value of the cite attribute in a <q> element.Syn 2 min read HTML | DOM Progress Object The Progress Object in HTML DOM is used to represent the HTML <progress> element. The <progress> element can be accessed by using getElementById() method.Property Values: labels: It returns the list of progress bar labels.max: It is used to set or return the progress bar value of the max 2 min read Like