dave
dave

Reputation: 1

Javascript template literals hide event.target elements?

Easy enough to work around but curious about why this is happening

console.log(e.target); // returns <input form="survey-entry-form" name="zip-code" id="zip-code">
console.log(`${e.target}`); // returns [object HTMLInputElement]

I haven't noticed this in any other situation with template literals

I tried with the template literal, then just typed e.target into the console and got what I expected.

Upvotes: 0

Views: 17

Answers (0)

Related Questions