0

My code:

<script>
    $('.Upload').on("click", function () {
        alert("Click event found using class as identifier");
    });

    $('#FileUpload1').on("click", function () {
        alert("Click event found using ID as identifier");
    });
</script>

<asp:FileUpload ID="FileUpload1" runat="server" CssClass="Upload" />

I'm using the latest version of Jquery(1.9) which is why I'm using .on instead of .live

But neither of my alerts fire when I click the 'browse' button.

Can anyone help at all ??

Thanks.

1 Answer 1

4

You must use delegation with .on() synthax, see equivalent to live():

$(document).on("click",".Upload",function(){...});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.