<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/react-101/lessons/react-jsx-advanced/exercises/jsx-event-listeners
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I don’t understand how the makeDoggy function can operate correctly when i don’t even pass it the required parameter (Inside the image in the kitty variable). I thought that it needed that parameter to select the image that should be modified, but how can the function be executed without knowing that parameter? Or does this parameter get passed on automatically because it is the name of the variable i use to call the function? The following code works perfectly and it doesn’t generate any error messages, but i don’t understand why it works.
var React = require(‘react’);
var ReactDOM = require(‘react-dom’);
function makeDoggy (e) {
// Call this extremely useful function on an .
// The will become a picture of a doggy.
e.target.setAttribute(‘src’, ‘https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-puppy.jpeg’);
e.target.setAttribute(‘alt’, ‘doggy’);
}
var kitty = (
);
ReactDOM.render(kitty, document.getElementById(‘app’));
<do not remove the three backticks above>