HTML and CSS Reference
In-Depth Information
max=
"1.0"
step=
"0.01"
value=
"1.0"
//>
The
textAlphaChanged()
function works just like the other event handler functions that we
created in this chapter:
function
function
textAlphaChanged
(
e
) {
var
var
target
=
e
.
target
;
textAlpha
=
(
target
.
value
);
drawScreen
();
}
Also, don't forget the event listener for the
textAlpha range
control:
formElement
=
document
.
getElementById
(
"textAlpha"
);
formElement
.
addEventListener
(
'change'
,
textAlphaChanged
,
false
false
);
The results will look like
Figure 3-7
.