Functions, Part I: $(document).ready doesn't work but lets me pass!


#1

Hello,

I've created this code;

$(document).ready(function(){

 $('div').ready(function(){
    
    $('div').hide();
    
    });

)};

The div isn't hiding, it's reporting a syntax error, but it's letting me pass. Am I missing something obvious?

Thanks for your help.
Bob


#2

Hi Bob,

You should remove the $('div').ready(...); part and put $('div').hide(); inside just the $(document).ready(...); part :slight_smile:

How it should look

$(document).ready(function() {
  $('div').hide();
});

#3

I am experiencing the same problem. I have filed a bug report about the autograder letting incorrect code to pass.


#4

Great thanks!

I also then realised that I had put my curly and normal brackets round the wrong way on the final line!


#5

@dj_mousefarm Good eye :slight_smile: Sometimes fixing just one problem will reveal several others :slight_smile:


#6

This topic is solved.