Font size
WorksheetsINT219
Total questions: 127
Worksheet time: 1hrs 3mins
JS Function is a block of code designed to perform a particular task.?
False
True
What does an JS Events do?
Event handlers can be used to handle, and verify, user input, user actions, and browser actions.
Do a event
None of the above
Which function among the following lets to register a function to be invoked once?
setTimeout()
setTotaltime()
setInterval()
settime()
How is everything treated in HTML DOM?
Node
Attributes
Elements
Arrays
Which object is the top of the hierarchy?
Window Object
Document Object
Form Object
Form Control Elements
What among the following is an appropriate event handler for input text among the below options ?
onclick
onchange
onkeyup
onblur
How are the objects organized in the HTML DOM?
Class-wise
Queue
Hierarchy
Stack
Consider the below code:
Identify the correct code in order to fetch the value entered in username text field?
< body>
< form name="register">
Enter username < input value="John" id="name" name="username">
< /form>
< /body>
document.register.name.value
document.getElementById ("name").value
document.getElementByName ("name").value
None of the above
The paragraph P Tag is a part of_______
<body>
<html>
<h1>
both <body> <html>
The node directly above a node is called
sibling
child
parent
ancestral
The node that represent html elements
subclassesnodes
windownodes
htmlnodes
elementnodes
In general, event handler is nothing but ____________
function
interface
event
handler
Which syntax is used to describe elements in CSS?
Protectors
Selectors
Both Protectors and Selectors
Protectors or Selectors
Which is the correct way to write a JavaScript array?
var txt = new Array(1:"arr",2:"kim",3:"jim")
var txt = new Array:1=(" arr ")2=("kim")3=("jim")
var txt = new Array("arr ","kim","jim")
var txt = new Array=" arr ","kim","jim"
How can you add a comment in a JavaScript?
//This is comment
'This is comment
<!-- This is comment-->
Which of the following JavaScript methods are you most likely to use to activate a button?
onmouseover
onload
whenclick
onclick
What DOM Property is used to update the text of an HTML tag?
id
innerHTML
src
style
What is one key characteristic of an id?
It must be capitalized
It must be unique to one tag
It cannot include numbers
It must go in the closing tag
Which of the following is the proper way to call the testFunction() function when a button is clicked?
onclick=testFunction
when button clicked = "testFunction()"
onclick="testFunction()"
onclick="testFunction"
<button onclick="aFunction()"> Click me </button>
What is output once the button is pressed?
aFunction() is called and its code get executed / aFunction () est appelée et son code est exécuté
Click me is displayed / Cliquez sur moi s'affiche
What do "purple", "green" in this code refer to?
var x1= document.getElementById("purple")
var x2= document.getElementById("green")
They are the IDs / Ce sont les ID
They are the names of the HTML / Ce sont les noms du HTML
They are the names of <h1> tags / Ce sont les noms des balises <h1>
They are the names of <p> tags / Ce sont les noms des balises <p>
Which of the following method checks if its argument is not a number?
isNaN()
nonNaN()
NaN()
None of the above
Which of the following is not JavaScript Data Types?
Undefined
Number
Boolean
Float
What are the types of Pop up boxes available in JavaScript?
Alert
Prompt
Confirm
All of the above
What is divide by 0 in Javascript? var a = 10;
var b = 0;
document.write(a/b);
Nothing is printed
0 is printed
Infinity is printed
Some Garbage Value
Does JavaScript allow exception handling?
A. Yes, it provides try, catch as well as throw key word for exception handling
Yes, but it provides only try block
Yes, but it provides only Try catch block, but does not allow throw exception
No
JavaScript is ______ Side Scripting Language.
JSP
Servlet
Server
Browser
JavaScript is designed for following purpose -
To Style HTML Pages
To Perform Server Side Scripting Opertion
To add interactivity to HTML Pages.
To Execute Query Related to DB on Server
JavaScript is can be written -
directly into JS file and included into HTML
directly into HTML pages
directly on the Server Script
None of these
JavaScript is an ________ language.
compiled
interpreted
JavaScript Code is written inside file having extension __________.
.jsc
.jvs
.js
.javascript
Is this correct syntax to include JS Code inside HTML Page ?
<script type="text/javascript">
...
</script>
Yes
No
We cannot Place JS Code in the body tag . Say true/false.
True
False.
These are any variable names listed within a function's argument definition.
example: myFunction(x, y)
Parameter
Literals
Constraints
Variables
Which of the Tag Pair is used to enable JS script writing in HTML?
<br>
<script>
<JS>
<code>
Which funtion is used when a JS application must ensure that the user gets the information that is displayed?
Alert box
Prompt Box
Combo Box
Confirm Box
Conditions return values of which data type?
Integer
boolean
floating-point
string
file extension for external JS files
.javascript
.js
.jscript
.script
used to write comments
++
=
//
--
What CSS Selectors selects HTML elements based on the element name?
CSS Class selector
CSS Element Selector
CSS ID Selector
None of the above
What CSS Selectors that is written with hash (#) character?
CSS Class selector
CSS Element Selector
CSS Universal Selector
None of the above
What method of CSS, that includes a reference a style sheet file inside a link.
Inline CSS
External CSS
Internal CSS
None of the above
In-line Styling: Change the color of the text
<p style:"color:blue">
<p style:"color:blue">
<p style="color:blue">
<p style="color=blue">
Where can we find what the stylesheet is called?
<link href="styles.css"> in the <head> tag
styles=styles.css
I have no idea
In the <body> tag
Bolded text tag?
<dark> </dark>
<bold> </bold>
<strong> </strong>
<heavy> </heavy>
CSS: How to change the background color of a paragraph or header?
background color: blue;
background-color: blue;
color: blue;
back-color: blue;
CSS: How to change the text color?
txt-color: red;
text color: red;
text-color: red;
color: red;
CSS: How to change the font of the text?
text-font: Calibri;
font: Calibri;
font-family: Calibri;
text font: Calibri;
Which selector will change the font of the text?
font-size
text-align
font-famiy
text-decoration
Which rule set would change the font size to 24?
font-size: 24
size: 24;
font-size: 24;
font size: 24;
Which type of CSS is used in the below code?
<p style = "border:2px solid red;">
Inline CSS
Internal CSS
External CSS
None of the above
Which property is used in CSS to change the background color?
bgcolor:
background-color:
color:
back-color:
Where in an HTML document is the correct place to refer to an external style sheet?
In the <head> section
At the top of the document
in the <body> section
At the end of the document
If we want define style for an unique element, then which css selector will we use ?
id
class
element
group
In CSS how to select the elements with the class name "example"?
example
#example
.example
Class example
What is the correct syntax to change the background color with css?
background-color: purple;
background-color = "purple";
backgroundcolor=orange
change-background-color: purple
What is missing from this HTML skeleton?
<!DOCTYPE html>
<html>
<body>
</body>
</html>
<head></head>
<div></div>
<img></img>
<head>
How do you change the font color with CSS?
font-color: green;
color: green;
change-font-color: green;
fontcolor=green;
Which of the following is the correct CSS link tag?
<link rel="styles" href="stylesheet.css">
<link href="stylesheet">
<link rel="stylesheet" src="styles.css">
<link rel="stylesheet" href="styles.css">
Which is the correct CSS syntax?
body {color: yellow;}
body:color=yellow;
{body:color= yellow;}
{body;color: yellow;}
Which one is the correct syntax for CSS?
property {selector : value}
value {property : selector}
selector {value : property}
selector { property : value}
What is the proper CSS format for background color?
back-ground color:orange:
backgroundcolor-orange;
background:color:orange;
background-color:orange;
What HTML code is used to center the words on the page when the coding starts on the left margin?
right-align;
<center></center>
left-align;
<middle></middle>
What is the correct code for a paragraph in CSS?
P
<p> </p>
.p
p{
}
The blue is called an _____________
Declaration
Selector
Property
Value
The blue is called an _____________
Declaration
Selector
Property
Value
The blue is called an _____________
Declaration
Selector
Property
Value
Which is the value in the CSS code below?
h1 {border: 29px solid red}
h1
border
29px solid red
{ }
To create a dotted border around the page
border-style
border-width
border-color
width
Change the border size of the body or image
border-style
border-width
border-color
width
sets the color of words in a paragraph
h1 {
color: pink;
}
img {
color: pink;
}
body {
color: pink;
}
p {
color: pink;
}
What does a class do?
adds color to words
adds style to specific elements
adds style to a whole page
adds a lot more work
Select the rule set to make all the text in your web page blue and centered.
p {
color: blue;
}
body {
text-align: left;
color: blue;
}
p {
text-align: center;
color: blue;
}
body {
text-align: center;
color: blue;
}
Which rule set would change the font size to 24?
font-size: 24
size: 24;
font-size: 24;
font size: 24;
What type of tag is this: <!-- -->
comments
questions
paragraph
image
<h1> is an example of a _______.
Headline Tag
Paragraph Tag
filename
<p> is a _______ tag.
image
paragraph
filename
What does a opening tag look like?
< >
</ >
<< >>
<
What does a closing tag look like?
< >
<\ >
</ >
<< >>
What should a HTML web page start with?
<b>
<li>
<html>
<start>
What should a HTML web page end with?
</html>
<head>
</end>
</body>
What is the difference between <h1> and <h2>?
<h1> is larger in size than <h2>
<h2> is larger in size than <h1>
both are the same size but different headings
none of the above
Which is the proper way to write an h1 tag
<h1>Hello</h1>
<h1>"Hello
{h1}Hello{/h1}
<h1>Hello<h1>
</p>
What will this code display?
8, 2, 1, 4, 7
82147
Myarray.length
5
What will this code display?
Hello Emma
Hello user
Hello+user
nothing
What will this code display?
570
569
568
attendees
What would this piece of code do?
change the background color of the word demo to red
change the font color of the demo element to red
this is not correct
styles the element with the class demo
Which of these is a method?
getElementById( )
style
document
color
Correct this code so that
Hello!
is displayed in the paragraph
with the id "demo"
add
.style.text
after ("demo")
add
.innerHTML
after ("demo")
add a semi colon after myFunction()
Save "Hello" in a variable first
The Document Object Model (DOM) can be used to:
Find elements by class
Create new elements
Retrieve data from a server
Change element styles
Float property works in which way?
Top
Left
Bottom
Right
Left
Right
Top
Bottom
Left
Bottom
Right
The output of the below code is:
<p id="demo"></p>
<script>
var text = "";
var i;
for (i = 0; i < 5; i++) {
text += "The number is " + i + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
The number is 0
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
The number is 0
The number is 1
The number is 2
The number is 3
The number is 4
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
Why is that person using "var"???
What is the difference between == and ===?
The === operator compares two values, without taking into account their types. == compares the values, but also makes their types into account.
Do I really need to reply this?
The == operator compares two values, without taking into account their types. === compares the values, but also makes their types into account.
The == operator is used to assign a value to a variable. === is used to compare the values of two variables.
What is the DOM?
Is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types
Is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript
Is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable
The Document Object Model is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document
What are HTML Tags?
HTML tags are composed of three things: an opening tag, content and ending tag. Some tags are unclosed tags.
HTML tags are composed of three things: an opening tag, content and ending tag. All tags need to be closed.
HTML tags define metadata about an HTML document. Metadata is data (information) about data.
I didn't know that I was supposed to be studying
Select the correct option:
The getElementsByName() method returns a live HTMLCollection of elements with the given tag name.
The getElementsByTagName() method returns a collection of all elements in the document with the specified name (the value of the name attribute), as an HTMLCollection object.
The innerHTML property sets or returns the text content of the specified node, and all its descendants.
The innerText property sets or returns the HTML content of an element.
let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used, unlike the var keyword, which declares a variable globally, or locally to an entire function regardless of block scope
The difference between POST and PUT is that POST requests are idempotent. That is, calling the same POST request multiple times will always produce the same result. In contrast, calling a PUT request repeatedly have side effects of creating the same resource multiple times.
Identify the name of the object in the following code:
var car = { model: "EXPLORER", brand: "Ford", IntroductionYear: 2019 }
car
"EXPLORER"
model
var
Identify a key in the following code:
var car = { model: "EXPLORER", brand: "Ford", IntroductionYear: 2019 }
car
"EXPLORER"
model
var
Identify a value in the following code:
var car = { model: "EXPLORER", brand: "Ford", IntroductionYear: 2019 }
car
"EXPLORER"
model
var
What is DRIVE in the code below?
var car = {
DRIVE: function()
alert("Drive");
}
A property
A method
A variable
A function
What is the code that allows you to make use DRIVE?
var car = {
DRIVE: function()
alert("Drive");
}
drive()
DRIVE()
car.drive()
car.DRIVE()
sets the color of words in a paragraph
h1 {
color: pink;
}
img {
color: pink;
}
body {
color: pink;
}
p {
color: pink;
}
Select the rule set to make all the text in your web page blue and centered.
p {
color: blue;
}
body {
text-align: left;
color: blue;
}
p {
text-align: center;
color: blue;
}
body {
text-align: center;
color: blue;
}
