Nikhil Jaitak Nikhil Jaitak - 2 years ago 81
jQuery Question

how to perform some action on span element of div?

I need help in selecting the span element within div so that i can perform action on click of these buttons (delete,rename,move). These buttons will come when i hover on any file. Many thanks in advance for help.

enter image description here

Answer Source
$(function(){ // equivalent to document on ready state
    $("body").on("click", "#delete", function(){
        //code goes here
    });
});

This should do the trick, and of course to handle all the spans you can replace the "#delete" with the id's of the other spans. Hope this helps!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download