Skip to content

Instantly share code, notes, and snippets.

@hiba-machfej
Created February 15, 2024 15:11
Show Gist options
  • Save hiba-machfej/be5b1687ed285b66c7a941715776a110 to your computer and use it in GitHub Desktop.
Save hiba-machfej/be5b1687ed285b66c7a941715776a110 to your computer and use it in GitHub Desktop.

Questions: Frontend File Setup

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?
@Mardin-luqman2001
Copy link

  1. How do you link a JavaScript file to an HTML document?

    • Using the <script> tag with the src attribute, like this:
      <script src="script.js"></script>
  2. How do you link a CSS file to an HTML document?

    • Using the <link> tag with the href attribute and rel="stylesheet", like this:
      <link rel="stylesheet" href="styles.css">
  3. What are the roles of HTML, CSS, and JavaScript on a webpage?

    • HTML provides the structure and content.
    • CSS styles the HTML elements to enhance appearance.
    • JavaScript adds interactivity and dynamic behavior.
  4. What is the DOM? How is it related to HTML, CSS, and JavaScript?

    • The DOM (Document Object Model) is a programming interface for web documents.
    • It represents the HTML document as a hierarchical tree of objects.
    • JavaScript interacts with the DOM to manipulate HTML and CSS dynamically.
  5. How does HTML get rendered into DOM?

    • HTML content is parsed and converted into a hierarchical DOM tree by the browser during page load.
  6. What are elements?

    • Elements are HTML building blocks consisting of start and end tags, defining structure and content.
  7. What are attributes in HTML?

    • Attributes provide additional information about HTML elements and are defined within the start tag.
  8. How can we interact with HTML?

    • We can interact with HTML using JavaScript to manipulate DOM elements, handle events, and update content dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment