Found 10483 Articles for Web Development

HTML DOM li value Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

158 Views

The Li value property returns/sets the value of the value attribute of a element.SyntaxFollowing is the syntax −Returning value of the value attributeliObject.valueValue of the attribute value setliObject.value = ‘string’Let us see an example for Li value property −Example Live Demo HTML DOM value    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    ol{       width: 30%;   ... Read More

HTML DOM li Object

AmitDiwan
Updated on 30-Jul-2019 22:30:26

143 Views

The HTML DOM Li Object in HTML represents the element.SyntaxFollowing is the syntax −Creating a elementvar liObject = document.createElement(“LI”)PropertiesHere, “LiObject” can have the following properties −PropertyDescriptionvalueIt returns/sets the value of the value attribute of a elementExampleLet us see an example for Li value property − Live Demo HTML DOM value    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    ol{ ... Read More

HTML DOM length Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

167 Views

The HTML DOM length property returns a number corresponding to the nodes in node list object.SyntaxFollowing is the syntax −Returning number of nodes in nodeList Object.nodeList.lengthExampleLet us see an example for HTML DOM length property − Live Demo HTML DOM length    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    ul{       width: 30%;       margin: 0 auto; ... Read More

HTML DOM Legend Object

AmitDiwan
Updated on 30-Jul-2019 22:30:26

125 Views

The HTML DOM Legend Object in HTML represents the element.SyntaxFollowing is the syntax −Creating a elementvar legendObject = document.createElement(“LEGEND”)PropertiesHere, “LegendObject” can have the following properties −PropertyDescriptionformIt returns a reference of enclosing form that contains the legend elementExampleLet us see an example for Legend form property − Live Demo Legend form    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } ... Read More

HTML DOM Legend form Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

121 Views

The HTML DOM Legend form property returns the reference of enclosing form for Legend tag.SyntaxFollowing is the syntax −Returning reference to the form objectlegendObject.formExampleLet us see an example for Legend form property − Live Demo Legend form    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Legend-form Examination Week:    var divDisplay = document.getElementById("divDisplay");    var legendForm = document.getElementById("legendForm");    function showExamination() {       divDisplay.textContent = 'Examinations: '+legendForm.form.id;    } OutputThis will produce the following output −Before clicking ‘What exams are in this week?’ button −After checking ‘What exams are in this week?’ button −

How to set dynamic property keys to an object in JavaScript?

Lokesh Yadav
Updated on 08-Dec-2022 08:13:41

3K+ Views

In the following example we are going to learn how to set dynamic property keys to an object in JavaScript. To add dynamic property keys to an object in JavaScript, there are three possible ways. There are three possible ways to set dynamic property keys to an object. The first possible way is to create a key and assign it to the object, second possible way is to set the dynamic property keys to an object using the define property method and the third possible way is to set the dynamic property keys to an object using ES6 method. We ... Read More

How to access an object value using variable key in JavaScript?

Lokesh Yadav
Updated on 08-Dec-2022 08:12:01

14K+ Views

In this article we are going to discuss how to access an object value using variable key in JavaScript. An object value can be accessed by a Dot Notation and a Bracket Notation. To get the object value through a variable key, the value or expression inside the bracket notation must match with the existing key name, then it returns a value. The bracket notation, unlike the dot notation can be used with variables. If we are using a variable with bracket notation, the variable must reference a string. Let’s understand this concept better with the help of examples further ... Read More

How to convert a value into Boolean in JavaScript?

Lokesh Yadav
Updated on 08-Dec-2022 08:10:12

904 Views

In this article we are going to discuss how to convert a value into Boolean in JavaScript. In JavaScript programming we sometimes need values like these ‘YES / NO, ‘ON / OFF’, ‘TRUE / FALSE’. So, JavaScript provides Boolean() method, which helps us to convert a value into Boolean. A Boolean is a value that can return either true/false. There are two ways using which we can convert values into Boolean. One way is to use Boolean() method and the other way is to use the !! notation. Let’s understand this concept better with the help of the examples further ... Read More

Print elements that can be added to form a given sum

Sunidhi Bansal
Updated on 30-Jul-2019 22:30:26

225 Views

Input number of elements user want to enters and than input the total value user want to calculate from the given list of elements.Input : N=5    Enter any 5 values : 3 1 6 5 7    Enter sum you want to check : 10 Output : 3 1 6AlgorithmSTART STEP1-> Take values from the user STEP2-> Take the sum a user want to check in the set. STEP3-> For i = 0; i < n; i++ STEP4-> Check If sum - *(ptr+i) >= 0 then,    STEP4.1-> sum -= *(ptr+i);    STEP4.2-> Print the value of *(ptr+i) END ... Read More

How to Find the action Attribute and method of a Form in JavaScript?

Lokesh Yadav
Updated on 27-Jan-2025 12:06:11

3K+ Views

In this article we are going to learn how to find the action attribute and method of a form with suitable examples in JavaScript. In HTML, there is  elements which has few attributes: input, label, text area, select, name, target. The action and method attributes of the form are used to return those values. The action attribute also specifies where to send the form data when form is submitted. To get a better idea of this concept, let’s look into JavaScript examples where we achieved the given task using action attribute and also with method attribute. Using action ... Read More

Advertisements