HI, NOT SURE WHAT I AM DOING WRONG IN THE JAVASCRIPT CODE.PLEASE HELP
Write and register an event handler that changes the color ofthe h3 tag to green on mouseout.
CHALLENGE ACTIVITY 6.3.1: Event-driven programming. 411320.1869374.qx3zqy7 Jump to level 1 Write and register an event handler that changes the color of the h3 tag to green on mouseout. JavaScript 1 <h1>Header 1</h1> 2 <h2>Header 2</h2> Check 3 <h3>Header 3</h3> 4 <p>Paragraph</p> 5 <a href="https://www.example.org/">Example.org</a> HTML Try again 2 3 >->~~ W
CHALLENGE ACTIVITY 6.3.1: Event-driven programming. 411320.1869374.qx3zqy7 Jump to level 1 Write and register an event handler that changes the color of the h3 tag to green on mouseout. HTML 1 let h3Element = document.getElementsByTagName("h3")[0]; 2 Check 3 4 5 var h2Element = document.getElementsByTagName("h3")[0]; 6 7 8 9 h2Element.addEventListener('mousemove', function () { 10 11 12 13 h2Element.style.color="green"; 14 i 15 }) 16 17 18 JavaScript Try again 3 > 1 2 3
6.3: Event-driven programming X Checking color on h3 element before any event Yours Yours has no value X Checking color on h3 after event on h3 Yours and expected differ. See highlights below. Yours Yours has no value Expected green Checking color on h1 after event on h1 Yours Yours has no value Checking color on h2 after event on h2 Yours Yours has no value Checking color on p after event on p Yours Yours has no value Checking color on a after event on a Yours Yours has no value View your last submission
HI, NOT SURE WHAT I AM DOING WRONG IN THE JAVASCRIPT CODE. PLEASE HELP Write and register an event handler that changes
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am