1. Make the red square disappear much slower (try using 3000 as an argument instead of 'fast').
2. When you click the green square, don't make it disappear. It appears now as if it is changing colors instead of generating a new square.
Bonus challenge: Now that you are starting to learn how to manipulate the DOM, have one of the squares generate a new square whenever you click on it, so that clicking on it 5 times will generate 5 new squares.
I would suggest two improvements to your example:
ReplyDelete1. Make the red square disappear much slower (try using 3000 as an argument instead of 'fast').
2. When you click the green square, don't make it disappear. It appears now as if it is changing colors instead of generating a new square.
Bonus challenge: Now that you are starting to learn how to manipulate the DOM, have one of the squares generate a new square whenever you click on it, so that clicking on it 5 times will generate 5 new squares.