Worksheetsjs basics
Total questions: 18
Worksheet time: 9mins
Which one of the following symbols is used for JavaScript comments?
//
\\
*/ */
<!-- -->
What type of variable is var typeOfApples="Fuji"
numeric
boolen
string
How do I declare a new variable?
var newVariable = 5
Variable int = new Variable()
var 5 = myVariable
int var = 5
What surrounds an if/else statement?
Quotations " "
Curly Brackets { }
Parenthesis ( )
Square Brackets []
What surrounds a string or words?
Quotations " "
Curly Brackets { }
Parenthesis ( )
Square Brackets []
Why do we use if/else statements in JavaScript?
To repeat something for a fixed number of times
To either do something if a condition is true or do something else
To break out of some block of code
To repeat something while a condition is true
Indicates the beginning and the end of a JavaScript section.
<html> </html>
<style> </style>
<article> </article>
<script> </script>
A JavaScript file has an extension name of
jscp
.js
.css
.Jp
Which keyword do we need to define a function?
function
method
onclick
functionName()
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;"
onclick="doSomething();"
on-click="doSomething;"
onclick=doSomething();
What is CSS used for?
styling web pages
formatting script correctly
client side scripting
server side scripting
Which of the following platform(s) can be used to run Javascript Code
Google Chrome
Firefox
Microsoft Edge
all of these
Safari
How do I change the size of an image?
width / height
scale
size
shrink
What is the difference between an HTML Tag and an HTML element?
An HTML Tag is case sensitive and an HTML element is not case sensitive.
An HTML Tag is always paired and an HTML element is an "empty" tag.
An HTML Tag defines content and an HTML Element includes the opening and closing tags and everything in between.
An HTML Tag defines content and an HTML Element gives additional meaning and content.
Karen wants to begin a new line within a paragraph of text on a webpage. Which code should she use?
<li>
<hr>
<h1>
<br>
Ali wants to insert a line break into his webpage. Which code should he use?
<ul>
<br>
<li>
<h1>
What is the proper code to insert an image named "frog.jpg"?
<img src="frog" width="104" height="142">
<img src="frog.jpg" width="104" height="142">
<img="frog.jpg" width="104" height="142">
height="142">
<img ="frog" width="104" height"142">
