NEW
Font size
WorksheetsJavascript Quiz 1
Total questions: 15
Worksheet time: 8mins
The ______ nethod returns an array of elements that match a specified tag name.
getElementById()
getElementByTagName()
getElementByClass()
querySelector()
Which of the following is the correct syntax for accessing an element with the id value for a headline?
document. getElementByID("headline")
document. getElementByID(headline)
document. getElementById("headline")
document. GetElementByID("headline")
The following code returns a list of all elements where the id = "intro"
var x = document.getElemensByClassName("intro");
TRUE
FALSE
What is the correct Javascript syntax to change the content of the HTML element below?
<p id="demo">This is a demonstration.</p>
document.getElementbyId('demo").innerHTML="Hello World!";
document.getElementById('demo").innerHTML="Hello World!"; #demo.innerHTML = "Hello World!";
document.getElementbyId('demo").innerHTML=Hello World!;
document.GetElementById('demo").innerHTML="Hello World!";
The Document Object Model (DOM) is a World Wide Web Consortium (W3C) standard.
TRUE
FALSE
Each element on a web page is represented in the HTML DOM by its own object.
TRUE
FALSE
The ____ property of the Image object allows Javascript to dynamically change an image.
id
class
size
src
Which of these lines of code is valid javascript for defining a variable?
var noseSize = 10;
var noseSize == 10;
noseSize is 10;
var nose Size = 10;
Which of these is a valid variable name in Javascript?
123abc
abc 123
abc123
abc123!
What is the correct syntax to use an external script called "new.js"?
<script src = "new.js">
<script name = "new.js">
<script href = "new.js">
<script content = "new.js">
Can you test Javascript code inside web browsers like Firefox, Chrome, Microsoft Edge?
TRUE
FALSE
Who created Javascript Language?
Brendan Eich
Douglas Crockford
James Gosling
Ryan Dahl
Javascript works inside web browsers only?
TRUE
FALSE
What is Javascript?
Scripting Language that follows ECMAScript standard
Client-side scripting language (web browsers)
Server-side scripting language
All of the choices are correct
Inside what HTML tag you would put JavaScript code?
<js>
<scripting>
<script>
<javascript>
