My jquery from external .js is not working?

my code is

    <script src=""></script>
    <script src="phc.js"></script>
    <button class="click-ctrl">jjasdnfjknfjdndfjndsnnakj</button>

my jquery



First mistake is you are looking for an element with a class called .click.

You don’t have one :slight_smile:

You have an element with a class of .click-ctrl which I guess is the one you meant.

The second error is that you added a dot before the classname in the addClass function. There is no dot required there because as you are adding a class jquery assumes it is a class.

Here is the revised code.

1 Like

thaks , that helped me.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.