Worksheets[AP CSP] JavaScript Basics
Total questions: 14
Worksheet time: 28mins
Which one of the following symbols is used for JavaScript comments? / Lequel des symboles suivants est utilisé pour les commentaires JavaScript?
\\
^
?
//
Which message will the user see? / Quel message l'utilisateur verra-t-il?
"Hello user"
No message
"Goodbye user"
"message + user"
How do I declare a new variable? / Comment déclarer une nouvelle variable?
var newVariable = 5
Variable int = new Variable()
var 5 = myVariable
int var = 5
How can a developer show a pop-up message to the user?
alert
prompt
console.log
<p> tag
What attribute/value do we use to make a button execute JavaScript when clicked?
onclick="doSomething;"
on-click="doSomething;"
onclick="doSomething();"
onclick=doSomething();
What is the correct syntax for referring to an external JavaScript script?
<script src="myscript.js"></script>
<script href="myscript.js"></script>
<js href="myscript.js"></js>
<js src="myscript.js"></js>
Indicates the beginning and the end of a JavaScript section.
<html> </html>
<style> </style>
<javascript> </javascript>
<script> </script>
Where do the <script></script> tags go in your document
Within <img> tags
In the <p></p> tags
In the <title>
In the <head> or <body>
You can change an image's size using Javascript?
True
False
Javascript can:
Interact with HTML
Check or validate user input
Can make your web pages dynamic
All of the above
JavaScript is used to enhance what kind of document?
JS
HTML
Brackets
