1
$(".bVid").on("click",function(){
        $(".vidBeginner").slideDown(1000);
});

On that JS code above, Chrome console keeps telling me the first "$" is not defined. There is a class in my html file called "bVid" and it's attached to a button. I also have it in my css file that's also attached to the html file in the header. Can anyone help me?

2 Answers2

0

Try using it like this:

    (function($){ 
        $(document).ready(function () {
           $(".bVid").on("click",function(){
              $(".vidBeginner").slideDown(1000);
           }); 
        });
    })(jQuery);

Make sure you have included the jquery cdn in script tags before calling this.

Pallavi Dwivedi
  • 186
  • 2
  • 12
0

First you need to check your jquery above your script then you need to use $(document).ready(function () function like given below

$(document).ready(function () {
$(".bVid").on("click",function(){
        $(".vidBeginner").slideDown(1000);
});
 });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Rohit Verma
  • 3,657
  • 7
  • 37
  • 75