How execute script in specific div

Viewed 275

So, in dom like this

<div>
    <button>Click me</button>
    <img src=#>
</div>

<div>
    <button>Click me</button>
    <img src=#>
</div>

<div>
    <button>Click me</button>
    <img src=#>
</div>

And script

$("button").click(function() {img.hide() });

How to make js to be executed only in div which contains clicked button? dom is generated, so we cant use specific classes or id's

5 Answers
Related