Exercise: Changing a button
Using the HTML document provided, complete the definition of startFunction
so that when the button is clicked, the font weight is changed to bold and the text becomes Done!
.
Note:
Hints:
Use
document.getElementById
to extract the button object.
Solution to the exercise
Here is a possible solution to the exercise.
Note:
Hints:
- undefined
1
2
window.onload = startFunction;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX