Exam in
24 questions
Which of the following lines of JavaScript code will change the HTML inside of an element with the attribute id="myElement" to "CS 105"?
How are the objects organized in the HTML DOM?
What is the work of the form control elements in the HTML DOM?
What is the correct JavaScript syntax to change the content of the HTML element <P id="demo">This is a demonstration.</p>
Which JavaScript method is used to access an HTML element by id?
Which property is used to define the HTML content to an HTML element with a specific id?
In HTML DOM, which of the following properties are read-only?
Which is the correct HTML statement to display Hello(strikethrough) Hi(underlined) in a paragraph?
To get the value of the text node of the h2 element node, you can use document.getElementById("id1").innerHTML which is equivalent to
Based on the above html page, the content of h2 element will be presented as
The number of objects in my variable is
By using this CSS selector div > p { color: red; }, how many p elements will be styled?
Using document.getElementById("id1").nodeType will return
In DOM, ChildNodes property returns elements and ignores text and comments.
What does document.querySelectorAll() return?
What does window.location.href return?
What is the purpose of window.history.back()?
How do you remove an element from the DOM?
What will be the output of "document.getElementById("id1").firstChild.nodeName;"?
If we wrote "var x=document.getElementsByTagName("p")" inside a script tag, then the length of x will be:
The value of x in this code, "x=document.body.children;" is:
If we wrote this code, "y=x[0].children" then y will contain:
If we wrote this code, "z=y[0].children; M=z[0].firstChild.nodeValue;" Then the value of M will be:
Question 3 - [8 Marks] 1. Display the text "My favorite subject is English Arabic" where "English" is struck-through and "Arabic" is underlined. [2marks] 2. Add a button labeled "Style" that, when clicked, changes the paragraph's: [3 marks for structure] Font color to green [1 mark], Font size to 14px [1 mark], Font family to Arial [1 mark]