treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Jquery isn't working... :( HELPPP

  • Hey guyz, I am facing a problem, when i run jquery inside my index.php file, It works pretty gud, but it's not working when I make an external file... Iam using xampp... I have made a folder js in htdocs and an index file out side the js folder...


    I have included the files like this in my index.php...




    But it's not working.. :(

    I have made a p tag in my index.php to hide it when i click it...

    This is a paragraph



    Here is what i have written in the hide.js file...

    $('#paragraph').click(function(){

    $(this).hide();
    }) ;


    HELP
  • check your console to see if ur getting any errors. As long as you can view source and find the jquery library linked correctly, then i would suggest dropping your javascript inside a document ready. try this if ur not already:

    $(function(){
    //your code
    });