Front End Technology Articles - Page 523 of 860

HTML DOM del cite Property

AmitDiwan
Updated on 15-Feb-2021 05:48:45

168 Views

The HTML DOM del cite property associated with the HTML element is used for telling the user why some text on the website was deleted. It does so by specifying the url which states why the given text was deleted.The del cite property increases the accessibility of our website as it has no visual cues but can help the screen readers. The del cite property sets or returns the value of the cite attribute of the HTML element.SyntaxFollowing is the syntax for −Setting the cite property −delObject.cite = URLHere, URL specifies the URL of the document that states ... Read More

First element and last element in a JavaScript array?

vineeth.mariserla
Updated on 20-Aug-2019 08:19:15

780 Views

An array is a group of elements. Each element has its own index value. We can access any element using these indexes. But in the case of the last element, we don't know the index until we know the number of elements present in the array. In this case, we have to use logic. Let's discuss these details in a nutshell.Accessing the first elementSince we know the index of the first element we can get the value of that element very easily. Let the array be arr. then the value of the first element is arr[0].ExampleIn the following example, there are ... Read More

HTML DOM Geolocation coordinates property

AmitDiwan
Updated on 20-Aug-2019 07:28:46

182 Views

The HTML DOM Geolocation coordinates property is used for getting a user’s device position and altitude on earth. The user have to approve that he wants to give coordinates before this property could work. This is done so that a user’s privacy isn’t compromised. This can be used for tracking various device's location.PropertiesFollowing are the coordinates property −Note − All these properties are read-only and their return type is double.Sr.NoProperty & Description1coordinates.latitudeTo return the device position’s latitude in decimal degrees.2coordinates.longitudeTo return the device position's longitude in decimal degrees3coordinates.altitudeTo return the position's altitude in meters, relative to sea level. It can ... Read More

HTML DOM fullscreenEnabled() method

AmitDiwan
Updated on 20-Aug-2019 07:20:46

118 Views

The HTML DOM fullscreenEnabled() method is used for specifying if the fullscreen mode is available or not for the current document. Its return type is boolean and is a read-only property. True is returned if the fullscreen mode is available otherwise it returns false. Different prefixes are used to make it work with your browser.SyntaxFollowing is the syntax for fullscreenEnabled() method −document.fullscreenEnabled()Let us look at an example for the fullscreenEnabled() method −Note − You will need to use your browser prefix for fullscreenEnabled() method to work. Check the note at the last to have your browser specific prefix.ExampleLet us see ... Read More

HTML DOM fullscreenElement property

AmitDiwan
Updated on 18-Feb-2021 09:18:18

156 Views

The HTML DOM fullscreenElement property is used for returning the element that is currently displayed in full screen mode. It will return null if the given element in not in fullscreen.SyntaxFollowing is the syntax for fullscreenElement property −document.fullscreenElementLet us look at an example of the fullscreenElement property −Note − This example only has standard syntax and browser prefix for Chrome, Safari and Opera. For your browser prefix, check the last section.ExampleLet us see an example −    function FullscreenEle() {       console.log(document.fullscreenElement || /*Standard Syntax*/       document.webkitFullscreenElement); /*For Chrome, Safari and Opera*/   ... Read More

HTML DOM Form target property

AmitDiwan
Updated on 20-Aug-2019 07:00:30

278 Views

The HTML DOM Form target property is used for specifiying where the response should be displayed after the form data has been submitted. It could display in a new tab, current tab or a new window. The form target property set or gets the target attribute value.SyntaxFollowing is the syntax for −Setting the target property −formObject.target = "_blank|_self|_parent|_top|framename"Here, _blank will open the response in new window, _self will open the response in the same window; parent will open in the parent frame, _top will open in full window body and framename will open it in a specified named frame.ExampleLet us ... Read More

HTML DOM Form submit() method

AmitDiwan
Updated on 20-Nov-2023 12:33:44

1K+ Views

The HTML DOM Form submit() method is used for submitting the form data to the address specified by the action attribute. It acts as a submit button to submit form data and it doesn’t take any kind of parameters.SyntaxFollowing is the syntax for Form submit() method −formObject.submit()ExampleLet us look at an example for the Form submit() method −    form{       border:2px solid blue;       margin:2px;       padding:4px;    }    function ResetForm() {       document.getElementById("FORM1").reset();       document.getElementById("Sample").innerHTML="Form has been reset";    } ... Read More

HTML DOM Form reset() method

AmitDiwan
Updated on 18-Nov-2023 03:35:42

1K+ Views

The HTML DOM Form reset() method is used for resetting all the values of the form elements and displaying the default values that are specified using the value attribute of the form elements. It acts as a reset button to clear form data and it doesn’t take any kind of parameters. Syntax Following is the syntax for form reset() method − formObject.reset() Example Let us look at an example of the Form reset() method −    form{       border:2px solid blue;       margin:2px;       padding:4px;    } ... Read More

HTML DOM Strong object

AmitDiwan
Updated on 19-Feb-2021 05:14:51

234 Views

The HTML DOM Strong object is associated with the HTML element. The strong tag is used for strong emphasis and makes the text bold. We can create and access strong element using the createElement() and getElementById() method respectively.SyntaxFollowing is the syntax for −Creating a strong object −Var s= document.createElement("STRONG");ExampleLet us look at an example for the strong object −Live Demo Strong object example Create a strong element by clicking the below button CREATE This is some text inside the p element    function createStrong() {       var s = document.createElement("STRONG");       var ... Read More

HTML DOM Storage setItem() method

AmitDiwan
Updated on 19-Feb-2021 05:16:28

137 Views

The HTML DOM Storage setItem() method is used for removing a storage object item by passing a given key name.SyntaxFollowing is the syntax for Storage removeItem() method −localStorage.removeItem(keyname, value);ORsessionStorage.removeItem(keyname, value );Here, keyname is of type string and represents the key name used for getting the value. The second parameter value represents the new value that will replace the old value.ExampleLet us look at the example for the Storage setItem() method −Live Demo Storage setItem() method example Create the localstorage item by clicking the below button CREATE Display the localstorage item by clicking the below button DISPLAY ... Read More

Advertisements