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?
by using script tag. example : <script src="./src/index.js"></script>
by using link tag. example :
HTML provides the basic structure of sites, which is enhanced and modified by other technologies like CSS and JavaScript.
CSS is used to control presentation, formatting, and layout.
JavaScript is used to control the behavior of different elements.
4.DOM is a W3C (World Wide Web Consortium) standard. It is a platform and language independent interface standard that allows programs and scripts to dynamically access and update the content, structure, and style of a document.
When a web page loads, the browser builds the page’s DOM tree. In this way, we can change all HTML properties on the page, remove existing HTML elements and attributes, add new HTML elements and attributes, or change all CSS styles on the page with scripting languages such as 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.
Elements are the basic building blocks of an HTML document and are represented by tags, such as
,
.
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: .
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.