Author: ShairyPortfolio
-

-

Manipulating Elements in DOM
1. createElement() – create a new element and returns a new Node with the Element type. Syntax let element = document.createElement(htmlTag); 2. appendChild() – append a node to a list of child nodes of a specified parent node. Syntax parentNode.appendChild(childNode); 3. textContent – get and set the text content of a node. Syntax let text…
-

Task Using Selecting Attribute of DOM
In the Below HTML Code task perform the following : First select the button with the id send by using the querySelector() method. Second, set the value of the name attribute to submit using the setAttribute() method. Then get the value of name attribute. Third, Paragraph is align right in the given HTML; remove the…
-

Use of Attribute in DOM
HTML Attributes & DOM Object’s Properties – understand the relationship between HTML attributes & DOM object’s properties. setAttribute() – set the value of a specified attribute on a element. getAttribute() – get the value of an attribute on an element. removeAttribute() – remove an attribute from a specified element. hasAttribute() – check if an element…