Unit 3 Notes Scripting & Networking
Unit 3 Notes Scripting & Networking
") [Link] Hello’) [Link] World’) [Link]”) SS}+ Properties: © [Link]: Refers to the element of the document and used to access or | manipulate the root element of the document. | _ Example: [Link]([Link]); e [Link]: || Refers to the element of the document and allows access to or manipulation of the section of the HTML. Example: I [Link]); ¢ [Link]: | Represents the title of the HTML document and used to get or set “the title using this property. Example: | [Link]([Link]); I [Link] = “ Javascript’; // Changes the title ¢ [Link]: | | Refers to the element of the document and allows access to or modification of the content within the tag. Example: [Link]); © [Link]: Provides the complete URL of the document currently loaded, _ Example: document writeCdocument, URL);7 Methods: © [Link]): Returns a single element with the specified value of the id attribute. It is used to access a unique element directly. Example: let element = [Link] myld); [Link](className); Returns a live HTMLCollection of elements with the specified class name. It is used to access multiple elements sharing the same class. _ Example: let elements = document getElementsByClassNameC myClass'); [Link](tagName): Retums a live HTML collection of elements with the specified tag nome. It is used to access all elements of a specific type, €.g., all or elements, Example: let paragraphs = [Link]'); [Link](name): | Returns all the elements with the specified value of the name , attribute. It is commonly used for form elements like or . Example: let inputs = document getElementsByNameC username’); Note: All these methods Cexcept getElementsByName) return live collections, meaning they update automatically if the DOM changes.Example of Document: