Chapter quiz · DOM & Platform APIs

Test what you learned.

8 questions on DOM & Platform APIs. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

DOM & Platform — Chapter Quiz

Eight questions on the DOM, events, forms, JSON, storage, regex, dates.

0/ 8
  1. Question 1
    1

    Which call returns ALL elements matching a CSS selector?

  2. Question 2
    2

    Setting el.innerHTML to a string containing user input can introduce an XSS vulnerability.

  3. Question 3
    3

    Inside a submit listener, what stops the browser from navigating?

  4. Question 4
    4

    What does this log?

    localStorage.setItem("n", 5);
    console.log(typeof localStorage.getItem("n"));
    
  5. Question 5
    5

    What does this log?

    const obj = { d: new Date("2026-01-01"), f: () => 1 };
    console.log(Object.keys(JSON.parse(JSON.stringify(obj))));
    
  6. Question 6
    6

    What does this log?

    console.log(new Date(2026, 4, 11).getMonth());
    
  7. Question 7
    7

    What does this log?

    const m = "hi-123-bye".match(/-(\d+)-/);
    console.log(m[1]);
    
  8. Question 8
    8

    To attach a function to a button's click event, call button._________("click", handler).

Pick an answer — instant feedback as you go.