Events for forms
Here are some of the event attributesExtra information added to an element. associated with forms:
Name | When activated |
---|---|
onfocus |
the cursor is on a fieldWays to collect information in forms. |
onblur |
the cursor is moved away from a field |
onchange |
a field is changed |
The onsubmit
event will not be used in this course, since we will not be submitting information to a server.
Note:
Hints:
- undefined
1
2
window.onload = startFunction;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
.blueback {
background-color: blue;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX