$(this) in JS asset function
Dear Appery,
i have a few html div's images inside an HTML widget:
code
<div class="btn food objects">
<img src="files/views/assets/image/g.jpg" alt="image" onClick=playThis('exampl1')>
</div>
Code: Select all
<div class="btn food">
<img src="files/views/assets/image/h.jpg" alt="image" onClick=playThis('exampl2')>
</div> /code
and a function in an outside JS asset:
code
function playThis (val) {
alert(val);
$(this).hide();
}
/code
although i get the correct val when clicking on each img but i dont get to hide the img...
what am i missing here?
Many thanks in advance!
Best,
R.