HTML | DOM Form target Property Last Updated : 31 Aug, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Form Target property is used to set or return the value of the target attribute of the form.The Target attribute is used to specify whether the submitted result will open in the current window, a new tab or on a new frame. Syntax: It is used to return the target property. formObject.target It is used to set the target property. formObject.target = "_blank|_self|_parent|_top|framename" Property Values _blank: It defines that submitted result will open in a new window or in a new tab. _self: It is the default value. It specify that the submitted result will be open in a same window. _parent: It specify that the result will be open in a parent frameset. _top: It specify that the result will open in a full body of the window. framename: It opens in a named frame. Return Value: It returns a string value which represents that whether the submitted result will open in the current window, a new tab or on a new frame. Example-1: HTML Program that illustrate how to set the Property. html <!DOCTYPE html> <html> <head> <title>DOM Form target Property</title> <style> h1 { color: green; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM Form target Property</h2> <form action="#" id="GFG" target="_self"> First name: <input type="text" name="fname"> <br> Last name: <input type="text" name="lname"> <br> Address: <input type="text" name="Address"> <br> <input type="submit" value="Submit"> </form> <BR> <b><p>Click on Try it Button to set the value of the target attribute.</p> <button onclick="Geeks()">Try it</button> <p id="sudo" style="color:green;fonnt-size:20px;"> </p> <script> function Geeks() { // Set _blank property. var x = document.getElementById( "GFG").target = "_blank"; document.getElementById("sudo").innerHTML = "The value of the target attribute was changed to" + x; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Example-2: HTML Program that illustrate how to return the property. html <!DOCTYPE html> <html> <head> <title>DOM Form target Property</title> <style> h1 { color: green; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM Form target Property</h2> <form action="#" id="GFG" target="_self"> First name: <input type="text" name="fname"> <br> Last name: <input type="text" name="lname"> <br> Address: <input type="text" name="Address"> <br> <input type="submit" value="Submit"> </form> <BR> <b><p>Click on Try it Button to return the value of the target attribute.</p></b> <button onclick="Geeks()">Try it</button> <p id="sudo" style="color:green;font-size:30px;"> </p> <script> function Geeks() { // Return form target property. var x = document.getElementById("GFG").target; document.getElementById("sudo").innerHTML = x; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Supported Browsers: Google Chrome 1 and above Edge 12 and above Firefox 1 and above Opera 12.1 and above Safari 3 and above Comment More infoAdvertise with us Next Article HTML DOM Location href Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML DOM Location href Property The Location href property in HTML is used to set or return the complete URL of the current page. The Location href property can also be used to set the href value point to another website or point to an email address. The Location href property returns a string that contains the entire URL of the p 2 min read HTML | DOM Input Image Object The Input Image Object in HTML DOM is used to represent the HTML < input > element with type=âimageâ. This tag is used to access or create the element. This element can be accessed by using getElementById() method. Syntax: document.getElementById("MyImage"); Return Value: It return the propert 3 min read HTML | DOM Ol start Property The DOM Ol start property is used to set or return the value of the start attribute in an ordered list. The start attribute in HTML is used to specify the start value for numbering the individual list item. It is used with an ordered list. Syntax: It is used to return the start property. olObject.st 2 min read HTML | DOM Option disabled Property The DOM Option disabled Property is used to set or return whether the value of an option would be disabled or not. The disabled attribute for the element in HTML is used to specify that the option value is disabled. A disabled option is un-clickable and unusable. It is a boolean attribute. Syntax: I 2 min read HTML | DOM KeyboardEvent keyCode Property The KeyboardEvent keyCode property is used for returning the Unicode character code of the key that has been used to trigger an onkeypress event. The KeyboardEvent keyCode property is also used for returning the Unicode character code of a key that has triggered an onkeydown or onkeyup event. The ke 2 min read HTML DOM InputEvent The input event is fired when the user changes an element, the value of an element or <textarea> element. DOM InputEvent occurs when an element in the HTML document gets input from the user. InputEvent property: data: Returns the inserted characters.dataTransfer: Returns an object containing i 2 min read HTML | DOM Parameter Object The Parameter Object in HTML DOM is used to create and access the <param> element with in the object.Parameters for plugin embedded with an element is done by using the element. Syntax: It is used to access a <param> element.var x = document.getElementById("myParam");It is used to create 2 min read HTML | DOM Link Object HTML DOM Link Object is used to access HTML <link> element.Syntax: To Access a HTML element: document.getElementById("myLink"); To Create a New HTML element: document.createElement("LINK"); Property Values: ValueDescriptioncharsetIt assigns the character encoding of the linked documentcrossOri 2 min read HTML DOM Style quotes Property The Style quotes Property in HTML DOM is used to set/return the type of quotation marks for embedded quotations. This element can be accessed by using getElementById() method. Syntax: To get the property.object.style.quotesTo set the property.object.style.quotes = "none | string string string string 2 min read HTML DOM KeyboardEvent getModifierState() Method The KeyboardEvent getModifierState() method in HTML DOM is used to return whether a specified modifier key is pressed, or activated. The KeyboardEvent getModifierState() method returns true if the specified key is pressed, otherwise it returns false. The list of key which is pressed then Modifier ke 1 min read Like