NEW
Font size
WorksheetsCalculator
Total questions: 15
Worksheet time: 30mins
Inside which HTML element do we put the JavaScript?.
Test
Text
<script>
What is the correct JavaScript syntax to change the content of the HTML element below?
document.getElementById(“demo“).innerHTML=”hello world”;
attributes
<>
Where is the correct place to insert a JavaScript?
img
hyperlink
Both <head> and <body>
src
How do you write "Hello World" in an alert box?
Target=”new”
msg(“Hello world”)
alert(“Hello world”)
Target=”_self”
How to Write JS Comments?
<!--this is a comment -->
<-- this is a comment -->
// this is a comment //
None of the Above
The external JavaScript file must contain the <script> tag.
True
False
How do you create a function in JavaScript?
fun function
function para()
function.mypara()
<th>
How do you call a function named "myFunction"?
square
call myfunction
myfunction()
myFunction()
How does a WHILE loop start?
<input type=”checkbox”>
<input type=”date”>
while(i <= 10)
_____________ is a single variable that is used to store different elements
array
legend
action
method
How does a WHILE loop start?
for(i=0; i <= 5; i++)
Heading in h2
Do Nothing
Which event occurs when the user clicks on an HTML element?
elements
OnClick
Both elements and OnClick
Which operator is used to assign a value to a variable?
/
=
+
-
How do you declare a JavaScript variable?
var carName;
GET
Request
None of the above
document.write(Hello there) what will this do?
Hello there
Hello there in the center of webpage
document.write(Hello there)
Both (a) and (b)
