
JavaScript Mouse over events
Quiz
•
Computers
•
10th - 12th Grade
•
Practice Problem
•
Medium
Zain Abaidin
Used 39+ times
FREE Resource
Enhance your content in a minute
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a mouse event?
onmousescroller
onclick
onmouseover
onmousemove
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the HTML tag for start of javascript code
<js>
<javascript>
<java>
<script>
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct place to insert JavaScript ?
The <body> section
The <head> section
Both <body> section and the <head> section are ok
Neither <body> section nor the <head> section - they should be in a separate file
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When is the mouseover event fired?
When mouse is moved over a new element
When mouse is clicked
When mouse is both moved and clicked
When mouse is released
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these will increase the value of the variable X?
increment (x)
x++;
x=x;
x+1;
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Pick right answer
<head>
<script type="text/javascript">
function OnMouseIn (elem) {
elem.style.border = "2px solid blue";
}
function OnMouseOut (elem) {
elem.style.border = "";
}
</script>
</head>
<body>
<div style="background-color:#d0f0a0; width:200px"
onmouseover="OnMouseIn (this)" onmouseout="OnMouseOut (this)">
Move your mouse pointer into and out of this element!
</div>
</body>
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the border color of div when mouse move over the the div?
let bx;
let by;
let boxSize = 75;
let overBox = false;
let locked = false;
let xOffset = 0.0;
let yOffset = 0.0;
function setup() {
createCanvas(720, 400);
bx = width / 2.0;
by = height / 2.0;
rectMode(RADIUS);
strokeWeight(2);
}
function draw() {
background(237, 34, 93);
// Test if the cursor is over the box
if (
mouseX > bx - boxSize &&
mouseX < bx + boxSize &&
mouseY > by - boxSize &&
mouseY < by + boxSize
) {
overBox = true;
if (!locked) {
stroke(255);
fill(244, 122, 158);
}
} else {
stroke(156, 39, 176);
fill(244, 122, 158);
overBox = false;
}
// Draw the box
rect(bx, by, boxSize, boxSize);
}
function mousePressed() {
if (overBox) {
locked = true;
fill(255, 255, 255);
} else {
locked = false;
}
xOffset = mouseX - bx;
yOffset = mouseY - by;
}
unction mouseDragged() {
if (locked) {
bx = mouseX - xOffset;
by = mouseY - yOffset;
}
}
function mouseReleased() {
locked = false;
}
Purple
Red
Orange
White
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Memahami HTML
Quiz
•
10th Grade
10 questions
IT Quiz
Quiz
•
11th - 12th Grade
10 questions
TỪ BÀI TOÁN ĐẾN CHƯƠNG TRÌNH
Quiz
•
11th Grade
10 questions
TIN HỌC 10 - BÀI 20
Quiz
•
10th Grade
10 questions
Podstawy Pythona
Quiz
•
9th - 12th Grade
10 questions
Sistemi e reti: CPU, von neumann
Quiz
•
12th Grade
10 questions
Немного о файлах и файловой системе
Quiz
•
8th - 10th Grade
8 questions
ทบทวนการเขียนโปรแกรมแบบมีเงื่อนไขและการออกแบบหน้าโปรแกรมทำงาน
Quiz
•
11th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
