Week 11: Event Binding
Complete and submit the following three exercises to go over JavaScript event binding:
-
Create an HTML page with two buttons that argue with each other. When one button is clicked, the text "I'm right" should be placed next to it. When the other button is clicked, the text is replaced with, "No, I'm right!"
-
Create a larger element on the page that says "Don't hover over me" inside of it. When you hover over the element, send an alert to the user that says, "Hey, I told you not to hover over me!"
-
Create and trigger a custom (not
click
,mouseover
, etc.) event in an implementation of your choice.
Try implementing these exercises in both native JavaScript and jQuery. Use at least one for credit.