HTML onFocus Event Attribute

AmitDiwan
Updated on 16-Feb-2021 04:30:10

199 Views

The HTML onfocus event attribute is used when an HTML element gets focus in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML onfocus event Attribute −Live Demo    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    textarea {       border: 2px solid #fff;       background: transparent;       font-size: 1rem;    }    ::placeholder {       color: #000;       font-size: 1rem;    } HTML onfocus Event Attribute Demo    function focusFn() {       document.querySelector('textarea').style.background = '#ffffff36';    } OutputNow enter your message in the text area to observe how onfocus event attribute works.

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

HTML del datetime Property

AmitDiwan
Updated on 15-Feb-2021 05:46:10

130 Views

The HTML DOM del dateTime property associated with the HTML element is used for telling the user when some text on the website was deleted. It tells the date and time of when the text was deleted.SyntaxFollowing is the syntax for −Setting the dateTime property −delObject.dateTime = YYYY -MM-DDThh:mm:ssTZDHere, YYYY=years , MM=months , DD=days, T=separator or a space, hh=hours , mm=minutes, ss=seconds, TZD=Time zone designatorExampleLet us look at an example for the del dateTime property −Live Demo del dateTime property example    #Sample{color:blue}; del dateTime property example Some text has been deleted Click ... Read More

HTML DOM del Object

AmitDiwan
Updated on 15-Feb-2021 05:44:17

155 Views

The HTML DOM Del object is associated with the HTML element. It is used to represent the element. Using the Del object we can create and access a elememt.PropertiesFollowing are the properties for the Del object −Sr.NoProperties & Description1citeTo set or return the cite attribute value of the deleted text.2dateTimeTo set or return the datetime attribute value of the deleted text.SyntaxFollowing is the syntax for −Creating a Del object −var p = document.createElement("DEL");ExampleLet us look at an example for the HTML DOM Del object −Live Demo del object example Click on the below button to ... Read More

HTML DOM Details Object

AmitDiwan
Updated on 15-Feb-2021 05:40:51

100 Views

The HTML DOM Details object is associated with the HTML element. This can allow us to hide the information that can only be displayed if user wants to see it.PropertiesFollowing is the property for the Details object −Sr.NoProperty & Description1openTo set or return if the details should be visible to the user or not.SyntaxFollowing is the syntax for −Creating the Details object −var p = document.createElement("DETAILS");ExampleLet us look at an example for the HTML DOM Details object −Live Demo Details object Click the below button to create a DETAILS element about a monument CREATE   ... Read More

HTML DOM Details Open Property

AmitDiwan
Updated on 15-Feb-2021 05:38:49

146 Views

The HTML DOM Details open property is associated with the HTML open property. It is a boolean attribute and used for specifying whether the details should be visible to the user or not. When set to true the details are visible to the user. However, while setting it to false means hide the details from the user.SyntaxFollowing is the syntax for −Setting the details open property −detailsObject.open = true|falseHere, true=Details will be shown and false=Details will be hidden. The details are hidden by default.ExampleLet us look at an example for the Details open property −Live Demo Details ... Read More

HTML DOM dfn Object

AmitDiwan
Updated on 15-Feb-2021 05:37:04

115 Views

The HTML DOM DFN object is associated with the HTML element. The text inside the element is the one being defined in the surrounding context. The DFN object represents the element.SyntaxFollowing is the syntax for −Creating a DFN object −var p = document.createElement("DFN");ExampleLet us look at an example for the HTML DOM DFN object −Live Demo DFN object example Click the below button to create a dfn element with some text inside it. CREATE    function dfnCreate() {       var x = document.createElement("DFN");       var t = document.createTextNode("The defination ... Read More

HTML DOM Input Password Value Property

AmitDiwan
Updated on 15-Feb-2021 05:21:55

744 Views

The HTML DOM Input password value property is associated with the input element having type=”password” and having the value attribute. This property is used for specifying a default value for password field and it also changes the value to user input.SyntaxFollowing is the syntax for −Setting the value property.passwordObject.value = text;Here, text is used for specifying the value for the password field.ExampleLet us look at an example for the input password value property −Live Demo Input password Value property PASSWORD: Get the above element value by clicking the below button Get Value    function getValue() ... Read More

HTML DOM Input Radio Checked Property

AmitDiwan
Updated on 15-Feb-2021 05:18:00

460 Views

The HTML DOM Input Radio checked property is associated with the checked property of an element with type radio. It is used to basically set or return the checked attribute value of the radio button.SyntaxFollowing is the syntax for −Setting the checked property.radioObject.checked = true|falseExampleLet us look at an example for the Radio checked property −Live Demo Input Radio checked property FRUIT: Mango Apple Check Apple    function checkApple() {       document.getElementById("Apple").checked = true;    } OutputThis will produce the following output −On clicking the “Check Apple” button −In the ... Read More

HTML DOM Input Radio DefaultChecked Property

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

143 Views

The HTML DOM Input Radio defaultChecked property checks whether the radio button has been checked by default or not. It returns true if the radio button is checked otherwise it will return false.SyntaxFollowing is the syntax for Radio defaultChecked property −radioObject.defaultCheckedExampleLet us look at an example of the Radio defaultChecked property −Live Demo Input Radio defaultChecked property FRUIT: Mango CHECK    function checkDefault() {       var c = document.getElementById("Mango").checked;       document.getElementById("Sample").innerHTML = "The button default checked value is "+c;    } OutputThis will produce the following output ... Read More

Advertisements