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 location of the JavaScript file.
2. To link a CSS file to an HTML document, you can use the tag and set the "href" attribute to the file path of your CSS file, and the "rel" attribute to "stylesheet".
3. HTML provides the structure and content of a webpage. CSS is used to style and layout the webpage. JavaScript allows for interactive and dynamic elements on the webpage.
4. The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the structure of a document as a tree-like object, allowing for manipulation and interaction with the elements of the document. It is related to HTML, CSS, and JavaScript as they all interact with the DOM to change the content and layout of a webpage.
5. HTML gets rendered into the DOM by the browser when a webpage is loaded. The browser reads the HTML code and creates a representation of it in the DOM, which can then be manipulated by JavaScript and CSS.
6. Elements are the basic building blocks of an HTML document, such as paragraphs, headings, images, and links. They are represented by tags in the HTML code and can have content, attributes, and other elements nested within them.
7. Attributes are additional pieces of information that can be added to an HTML element to provide additional information about that element or to control its behavior. They are specified in the opening tag of an element, and consist of a name and a value.
8. We can interact with HTML by manipulating the DOM using JavaScript, which allows us to change the content, layout, and behavior of elements on a webpage dynamically. We can also use CSS to change the styling of elements, and use HTML to change the structure and content of the webpage.