HTML DOM Input Password Name Property

AmitDiwan
Updated on 19-Feb-2021 08:10:20

142 Views

The HTML DOM Input Password name property is used for setting or returning the name attribute of an input password field. The name attribute helps in identifying the form data after it has been submitted to the server. JavaScript can also use the name attribute to refer form elements to manipulate later on.SyntaxFollowing is the syntax for −Setting the name property −passwordObject.name = nameHere, name is for specifying the password field name.ExampleLet us look at an example for the password name property −Live Demo Input Password name Property Password: Change the name of the password field by ... Read More

HTML DOM Emphasized Object

AmitDiwan
Updated on 19-Feb-2021 08:09:10

121 Views

The HTML DOM emphasized object is associated with the HTML element. The element is used for emphasizing some text and it marks that text in italic. You can create and access emphasized object using createElement() or getElementById() method respectively.SyntaxFollowing is the syntax for −Creating an emphasized object −var e = document.createElement("EM");ExampleLet us look at an example for the emphasized object −Live Demo emphasized object example Create an em element by clicking the button below CREATE    function createEM() {       var e = document.createElement("EM");       var txt = document.createTextNode("HELLO WORLD"); ... Read More

HTML DOM Fieldset Disabled Property

AmitDiwan
Updated on 19-Feb-2021 08:03:10

395 Views

The HTML DOM Fieldset disabled property is used for disabling the group of elements that are present inside a given fieldset. If this property is set to true then the elements are disabled else they are enabled, which is by default as well. Disabled elements are rendered in grey by default by browsers and users can’t click or write in those elements.SyntaxFollowing is the syntax −To set the disabled property −fieldsetObj.disabled = true|falseTo return the disabled property −fieldsetObj.disabledExampleLet us look at an example for the Fieldset disabled property −Live Demo    function FieldDisable() {       ... Read More

HTML DOM Fieldset Name Property

AmitDiwan
Updated on 19-Feb-2021 07:46:39

225 Views

The HTML DOM Fieldset name property is used for getting or setting the name attribute value of a element. The name attribute helps in identifying the form data after the form has been submitted or for simply referencing the form elements.SyntaxFollowing is the syntax for −Setting the fieldset name property −fieldsetObject.name = nameHere, name specifies the fieldset name.ExampleLet us look at an example for the Fieldset name property −Live Demo    function fieldName() {       var field = document.getElementById("FieldSet1").name;       document.getElementById("Sample").innerHTML = "The fieldset name is "+field;    } ... Read More

HTML DOM Fieldset Object

AmitDiwan
Updated on 19-Feb-2021 07:44:28

166 Views

The HTML DOM Fielset object represents the element.PropertiesFollowing are the properties for Fieldset object −PropertyDescriptiondisabledTo set or return if the fieldset is disabled, or notformTo return the reference to the form that contains the given fieldset.nameTo set or return the name attribute value of a fieldset.typeTo return the fieldset element type.SyntaxFollowing is the syntax for −Creating a fieldset element −var p = document.createElement("FIELDSET");ExampleLet us look at an example for the HTML DOM Fieldset object −Live Demo    function createField() {       var f = document.createElement("FIELDSET");       var txt = document.createTextNode("FIELDSET element created"); ... Read More

HTML DOM Fieldset Type Property

AmitDiwan
Updated on 19-Feb-2021 07:41:05

154 Views

The HTML DOM Fieldset type property is used for returning the fieldset element type. It will always be of type fieldset for a fieldset element. It is a read-only property.SyntaxFollowing is the syntax for Fieldset type property −fieldsetObject.typeExampleLet us take a look at an example for the Fieldset type property −Live Demo    function FieldType() {       var field = document.getElementById("FieldSet1").type;       document.getElementById("Sample").innerHTML = "The fieldset element is of type "+field;    } Sample FORM User Data: Name: Address: Age: GET TYPE ... Read More

HTML DOM Figcaption Object

AmitDiwan
Updated on 19-Feb-2021 07:35:22

114 Views

The HTML DOM Figcaption object is used for representing the HTML5 element. You can create or access a figcaption element using createElement() and getElementById() method respectively.SyntaxFollowing is the syntax for −Creating a Figcaption object −var p = document.createElement("FIGCAPTION");ExampleLet us look at an example for the Figcaption object −Live Demo    function createCaption() {       var caption = document.createElement("FIGCAPTION");       var txt = document.createTextNode("Learn Java Servlets");       caption.appendChild(txt);       var f=document.getElementById("Figure1");       f.appendChild(caption);    } Caption Create a caption for the below image by ... Read More

Day of the Week in C++

Arnab Chakraborty
Updated on 19-Feb-2021 07:24:45

7K+ Views

Suppose we have a date (day, month and year). From this date, we have to find the day of the week of that given date. To solve this we will use Zeller’s Algorithm. The formula to find weekday using Zeller’s Algorithm is here𝑤=$$\lgroup d+\lfloor \frac{13(m+1)}{5} \rfloor+y+\lfloor\frac{y}{4} \rfloor+\lfloor\frac{c}{4} \rfloor+5c \rgroup mod 7$$The formula is containing some variables; They are −d − The day of the date.m − It is the month code. For March to December, it is 3 to 12, for January it is 13, and for February it is 14. When we consider January or February, then the given ... Read More

HTML DOM Footer Object

AmitDiwan
Updated on 19-Feb-2021 07:23:32

652 Views

The HTML DOM Footer object is associated with the HTML element. The element is a type of semantic tag and introduced in the HTML5. Using the Footer object we can create and get the element using the createElement() and getElementById() method respectively.SyntaxFollowing is the syntax for −Creating a footer object −var p = document.createElement("FOOTER");ExampleLet us look at an example of the Footer object −Live Demo    function createFoot() {       var f = document.createElement("FOOTER");       document.body.appendChild(f);       var p = document.createElement("P");       var txt = document.createTextNode("Copyright ... Read More

HTML DOM Form Autocomplete Property

AmitDiwan
Updated on 19-Feb-2021 07:20:57

176 Views

The HTML DOM Form autocomplete property is associated with the autocomplete attribute of the form element. Using the autocomplete property we can set or return autocomplete attribute value of the given form. This property specifies if the input field should autocomplete text being written by the user based on the text that was previously written in the text field.The autocomplete property can be turned off for specific input fields if autocomplete is set on for the form and it is true for vice-versa also.SyntaxFollowing is the syntax for −Set the autocomplete property −formObject.autocomplete = on|offHere, “on” is by default and ... Read More

Advertisements