I\'m trying to change the contents of a div when it\'s hovered over using JQuery. I\'ve seen answers on stack overflow, but I can\'t seem to get it working.
I\'ve tried
First of all, replace $("imgDiv")
with $("#imgDiv")
to get the element with id (#) imgDiv
.
Then And finally, $("tdiv").textContent doesn't exist. You can try -- Quick reminder : jQuery documentation on selectors$("tdiv")
doesn't exist, you probably mean $("div")
to select a $("div").html()
or $("div").text()
to get the $("div")
will select the $(".element")
will select tags with class="element"
$("#element")
will select tags with id="element"