mozew's avatar
Level 6

Why is this jQuery click function not working?

Code

$(document).ready(function() {
    let countStudy = 1;
    $('#addSocial').click(function () {
        countStudy++;
        dynamicStudy(countStudy);
    });
});

The above code doesn't work. When I click on #clicker, it doesn't alert and and it doesn't hide. I checked the console and I get no errors. I also checked to see if JQuery was loading and indeed it is. So not sure what the issue is. I also did a document ready function with an alert and that worked so not sure what I am doing wrong. Please help. Thanks!

0 likes
5 replies
mozew's avatar
Level 6

I have step wizard form like this

step

And dynamicStudy is like this

socials

The addSocial is + button

Sinnbeck's avatar

Well perhaps you should show the actual code then :) The dynamicStudy() function is what isnt working

Also I dont know what you mean by it doesn't alert and and it doesn't hide. The code you posted, does not alert or hide :)

mozew's avatar
Level 6

It also does not show a alert.

$(document).ready(function() {
    let countStudy = 1;
    $('#addSocial').click(function () {
        alert('hi');
        countStudy++;
        dynamicStudy(countStudy);
    });

Please or to participate in this conversation.