views:

36

answers:

3

So I am working with some jquery code to do a simple hide of a p and a show of a p. I am simple adding a class called showp and showing it while making sure the others are not shown by hiding them first. But I keep getting an error missing : after property ID. Any help would be greatly appreciated.

    $(document).ready({
    $("#phone").click(function(){
        $(".hide2").addClass(".hide2").hide("slow");
        $(".hide3").addClass(".hide3").hide("slow");
        $(".hide1").addClass("showp").show("slow");
    });
});
+1  A: 

Try this:

$(document).ready(function() {
    $("#phone").click(function() {
      $(".hide2, .hide3").hide();
      $(".hide1").show();
    });
});
kovshenin
+2  A: 

Change this:

$(document).ready({

To this

$(document).ready(function(){
Luca Matteis
Ah! Thanks so much! That did it :)!
Nathan Stanford II
@Nathan - mark this as correct then!
ScottE
+1  A: 

Your document ready is invalid.

$(document).ready(function() {
  // stuff here.
});

Or better yet, a shorthand:

$(function() {
  // stuff here.
});
ScottE