
JavaScript Mouse over events

Quiz
•
Computers
•
10th - 12th Grade
•
Medium
Zain Abaidin
Used 39+ times
FREE Resource
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
Similar Resources on Wayground
7 questions
مراجعة عامة في العلامات المخصصة للغة الـ HTML

Quiz
•
10th Grade
10 questions
HTML(1)

Quiz
•
10th Grade
10 questions
Bài 7: HTML và cấu trúc trang web

Quiz
•
12th Grade
9 questions
HTML Basics

Quiz
•
9th Grade - Professio...
10 questions
Bài 25 tin 10

Quiz
•
9th Grade - University
10 questions
HTML QUIZ - Advanced

Quiz
•
9th - 12th Grade
12 questions
HTML Intro

Quiz
•
9th - 12th Grade
12 questions
Text File Pop Quiz

Quiz
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
CTEA Computer Vocab Terms #1

Quiz
•
12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade