Found 2417 Articles for HTML

HTML DOM Legend Object

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

84 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

88 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 −

HTML DOM lastModified Property

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

50 Views

The HTML DOM lastModified property returns the date and time the current document was last modified.SyntaxFollowing is the syntax −Returning date and time −document.lastModifiedExampleLet us see an example for HTML DOM lastModified property − Live Demo HTML DOM lastModified    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } HTML-DOM-lastModified NOTICE:    var divDisplay = document.getElementById("divDisplay");    var textSelect = document.getElementById("textSelect");    function getNoticeIssuedTime() {       divDisplay.textContent = 'Notice was issued on: '+document.lastModified;    } OutputThis will produce the following output −Before clicking ‘When was this issued?’ button −After clicking ‘When was this issued?’ button −

HTML DOM lastElementChild Property

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

40 Views

The HTML DOM lastElementChild property returns the last element node as node object of the specified node.NOTE − This property does ignore text and comment nodesSyntaxFollowing is the syntax −Returning lastElementChild nodenodeList.lastElementChildExampleLet us see an example for HTML DOM lastElementChild property − Live Demo HTML DOM lastElementChild    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    ul{       width: 30%; ... Read More

HTML DOM lastChild Property

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

51 Views

The HTML DOM lastChild property returns the last element node as node object of the specified node.NOTE − This property does not ignore text and comment nodesSyntaxFollowing is the syntax −Returning lastChild nodenodeList.lastChildExampleLet us see an example for HTML DOM lastChild property − Live Demo HTML DOM lastChild    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    ul{       width: ... Read More

HTML DOM lang Property

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

68 Views

The HTML DOM lang property returns/sets a string depicting a language code such as ‘en’ for ‘english’ of the element’s content.SyntaxFollowing is the syntax −Returning language codeHTMLElementObject.langSetting lang attribute to a language codeHTMLElementObject = ‘lang_code’ExampleLet us see an example for HTML DOM lang property − Live Demo HTML DOM lang    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } ... Read More

Print elements that can be added to form a given sum

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

173 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

HTML DOM Label Object

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

171 Views

The HTML DOM Label Object in HTML represents the element.SyntaxFollowing is the syntax −Creating a elementvar labelObject = document.createElement(“LABEL”)PropertiesHere, “LabelObject” can have the following properties −PropertyDescriptionControlIt returns the control of the labelformIt returns a reference of enclosing form that contains the labelhtmlForIt returns/sets the value of the for attribute of a labelExampleLet us see an example for Label htmlForproperty − Live Demo Label htmlFor    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px; ... Read More

HTML DOM Label htmlFor Property

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

152 Views

The HTML DOM Label htmlFor property returns/sets the value of for attribute.SyntaxFollowing is the syntax −Returning value of for attribute −labelObject.htmlForExampleLet us see an example for Label htmlForproperty − Live Demo Label htmlFor    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Label-htmlFor Current Editor: Label for attribute set as editor two ... Read More

HTML DOM KeyboardEvent Object

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

50 Views

The HTML DOM KeyboardEvent Object represents an event when user presses a key on keyboard.PropertiesHere, “KeyboardEvent” can have the following properties and methods −Property/MethodDescriptionaltKeyIt returns whether the "ALT" key was pressed or notcharCodeIt returns the Unicode character code of the keycodeIt returns the code of the keyctrlKeyIt returns whether the "CTRL" key was pressed or notgetModifierState()It returns true if the specified key is activated and false if inactiveisComposingIt returns whether the state of the event is composing or notkeyIt returns the key value of the key represented by the eventkeyCodeIt returns the Unicode character code of the key that triggered ... Read More

Advertisements