Answer the following questions with your group:
- How do you link a JavaScript file to an HTML document?
- How do you link a CSS file to an HTML document?
- What are the roles of HTML, CSS, and JavaScript on a webpage?
- What is the DOM? How is it related to HTML, CSS, and JavaScript?
- How does HTML get rendered into DOM?
- What are elements?
- What are attributes in HTML?
- How can we interact with HTML?
1/To link a JavaScript file to an HTML document, you can use the script tag and set the "src" attribute to the file path of the JavaScript file. Example: <script src="path/to/script.js"></script>
2/To link a CSS file to an HTML document, you can use the link tag and set the "href" attribute to the file path of the CSS file and the "rel" attribute to "stylesheet". Example:
3/HTML is used to structure and define the content of a webpage, CSS is used to style and layout the webpage, and JavaScript is used to add interactivity and dynamic functionality to the webpage.
4/The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the structure of a webpage in a tree-like format and allows for manipulation of the elements and attributes of the webpage using JavaScript.
5/HTML is rendered into the DOM by a web browser when a webpage is loaded. The browser parses the HTML code and creates a tree-like structure that represents the elements and attributes of the webpage.
6/Elements are the basic building blocks of an HTML document and are represented by tags.
7/Attributes provide additional information about an HTML element and are used to define properties and behaviors of the element. They are added to the opening tag of an element and are in the form of name-value pairs. Example:
8/To interact with HTML, you can use JavaScript to manipulate the elements and attributes of the webpage using the DOM API. This includes methods such as getElementById, querySelector, and innerHTML. Additionally, you can also use JavaScript events to respond to user interactions, such as a button click.