javascript - button not calling the correct function -
one of table cells has following content:
<td> <span onclick="deleteproductvariants()" class="icon icon-trash"></span> <button class="done" onclick="update_attributes(this)">done</button> </td>
my problem when click button, seems it's still deleteproductvariants()
called. don't have idea why- did encounter before?
note: none of them in form have been submitted or anything. it's function called, weirdly.
here jquery example....
<td> <span id="deleteproductvariants" class="icon icon-trash"></span> <button class="done" id="update_attributes">done</button> </td> $('document').ready(function(){ $('#deleteproductvariants').click(function(){ alert($(this)); }); $('#update_attributes').click(function(){ alert($(this)); }); });
Comments
Post a Comment