Front End Technology Articles - Page 533 of 860

HTML DOM Geolocation position property

AmitDiwan
Updated on 18-Jun-2020 08:59:53

198 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/she wants to give coordinates before this property could work. This is done so that users privacy isn’t compromised. This can be used for tracking various devices location.PropertiesFollowing is the position property −Note − The below properties are read-only −PropertyDescriptionposition.coordsTo return a coordinates object having information like latitude, longitude, altitude, and speed of the device on the earth. It also has an accuracy value describing how accurate the measurements are in meters.position.timestampTo representing the time and ... Read More

HTML DOM Form object

AmitDiwan
Updated on 20-Feb-2021 05:07:36

3K+ Views

The HTML DOM Form object is associated with the HTML element. We can create and access a form element using the createElement() and getElementById() method of the document object. We can set various properties of the form object and can get them too.PropertiesFollowing are the Form object properties −PropertyDescriptionacceptCharsetTo set or return the accept-charset attribute value in a form.ActionTo set or return the action attribute value of the formAutocompleteTo set or return the autocomplete attribute value of the form.EncodingIt is just an alias of enctype.EnctypeTo set or return the enctype attribute value of the form.LengthTo return how many elements ... Read More

HTML DOM Form name Property

AmitDiwan
Updated on 20-Feb-2021 05:09:07

300 Views

The HTML DOM Form name property is associated with the name attribute of the form element. The form name property is used for setting or getting the form name attribute value. The form name property gives the name to the form.SyntaxFollowing is the syntax for −Setting the form name −formObject.name = nameHere, the name specifies the name of the form.ExampleLet us look at an example of the Form name property −Live Demo    form {       border:2px solid blue;       margin:2px;       padding:4px;    }    function ChangeName() { ... Read More

Insert a specified HTML text into a specified position in the JavaScript document?

Lokesh Yadav
Updated on 09-Dec-2022 05:50:36

977 Views

In this article, we are going to learn how to insert a specified HTML text into a specified position in the JavaScript document with suitable examples. There is an existing method in the JavaScript to insert a specified HTML text into a specified position in the JavaScript document i.e. insertAdjacentHTML() method. There are four specified legal positions. The first position is ‘afterbegin’, the second is ‘afterend’, third is ‘beforebegin’ and the fourth legal position is ‘beforeend’. Let’s use the above discussed specified legal postions in the examples below. Syntax The syntax to insert a specified HTML text into a specified ... Read More

HTML DOM DT object

AmitDiwan
Updated on 20-Feb-2021 05:13:35

105 Views

The HTML DOM DT object is associated with the HTML element.Using the DT object we can create the element dynamically using JavaScript.SyntaxFollowing is the syntax for −Creating a DT object −var p = document.createElement("DT");ExampleLet us look at an example for the HTML DOM DT object −Live Demo DT object example Create a DT element inside a DL by clicking the below button CREATE    function createDT() {       var Desc = document.createElement("DL");       var DesT = document.createElement("DT");       var tn= document.createTextNode("Mango");       DesT.appendChild(tn);       var ... Read More

HTML DOM DragEvent

AmitDiwan
Updated on 20-Feb-2021 05:16:34

257 Views

The HTML DOM DragEvent is a type of event that gets executed whenever the selected text is being dragged and dropped. This event was introduced in HTML5.PropertiesFollowing is the property for the HTML DOM DragEvent −PropertyDescriptiondataTransferTo return the data that is being dragged or dropped by the user.SyntaxFollowing is the syntax for DragEvent −Object.DragEventType= function_name;Here, function_name is the function that we want to execute on the event being executed.EventsFollowing are the event types belonging to the DragEvent object −EventDescriptionondragOccurs when an element is being dragged.ondragendOccurs when the element has been finished dragging by the user.ondragenterOccurs when the element enters the ... Read More

Value of the class attribute node of an element in JavaScript?

vineeth.mariserla
Updated on 08-Aug-2019 14:37:37

398 Views

Javascript has provided the getAttributeNode() method to find the attribute node with the specified name of an element, as an attribute object. If the attribute does not exist, the return value is null or an empty string ("").syntaxelement.getAttributeNode(attributename);It returns the attribute object representing the specified attribute node ExampleIn the following example, there are two heading tags with different classes. Those tags when accessed by the getAttributeNode() can return the attribute class with which they attached. It works the same as an array. We can access the multiple classes only by providing their index numbers.Live Demo Tutorix Tutorialspoint var elmnt ... Read More

HTML DOM dl object

AmitDiwan
Updated on 20-Feb-2021 05:28:28

275 Views

The HTML DOM dl object is associated with the HTML element. The element is for creating the description list. Using the dl object we can dynamically create and acess the element using JavaScript.SyntaxFollowing is the syntax for −Creating a description list −var p = document.createElement("DL");ExampleLet us look at an example for the dl object −Live Demo Div object example Create a div by clicking the below button CREATE    function createDiv() {       var Desc = document.createElement("DL");       var DesT = document.createElement("DT");       var tn= document.createTextNode("Mango");     ... Read More

HTML DOM div object

AmitDiwan
Updated on 20-Feb-2021 05:30:06

520 Views

The HTML DOM div object is associated with the HTML element. Div is a general purpose block level element that allows us to group elements together to either apply style to them or to manipulate a group of HTML elements under a single tag name or id.PropertiesFollowing is the property for div object −PropertyDescriptionAlignTo set or return the align attribute value of the element. This property is not supported in HTML5 use css instead for aligning.SyntaxFollowing is the syntax for −Creating a div object −var p = document.createElement("DIV");ExampleLet us look at an example for the HTML DOM div ... Read More

HTML DOM dir property

AmitDiwan
Updated on 20-Feb-2021 05:31:34

164 Views

The HTML DOM dir property is used for changing an element’s text direction from default left to right to right to left or auto. The dir property is used for setting and returning the dir attribute value of an element. The returned dir attribute value is of type string.SyntaxFollowing is the syntax for −Setting the dir property −HTMLElementObject.dir = "ltr|rtl|auto"Here, ltr=left to right text direction and it is the default text direction., rtl=right to left text direction, auto=text direction is based on content here and is usually figured by the web browser.ExampleLet us look at an example for the HTML ... Read More

Advertisements