Skip to main content
deleted 26 characters in body
Source Link
Bill the Lizard
  • 407.3k
  • 213
  • 579
  • 892

So Im new to javascript and I am having trouble implementing the jqueryjQuery .addClass().addClass() effect.

The script I am trying to use looks like this:

<script>
    $(function(){   
        $('#top_right_size_large').click(function(){
            $('#primary').addClass('large_content');
        });
    });
    </script>

I've looked at the documentation and checked all of my parenthesizes but for whatever reason this doesn't add the .large_content class when the #top_right_size_large anchor is clicked. Any ideas why this wouldn't work the way I expect it to?

So Im new to javascript and I am having trouble implementing the jquery .addClass() effect.

The script I am trying to use looks like this:

<script>
    $(function(){   
        $('#top_right_size_large').click(function(){
            $('#primary').addClass('large_content');
        });
    });
    </script>

I've looked at the documentation and checked all of my parenthesizes but for whatever reason this doesn't add the .large_content class when the #top_right_size_large anchor is clicked. Any ideas why this wouldn't work the way I expect it to?

I am having trouble implementing the jQuery .addClass() effect.

The script I am trying to use looks like this:

<script>
    $(function(){   
        $('#top_right_size_large').click(function(){
            $('#primary').addClass('large_content');
        });
    });
    </script>

I've looked at the documentation and checked all of my parenthesizes but for whatever reason this doesn't add the .large_content class when the #top_right_size_large anchor is clicked. Any ideas why this wouldn't work the way I expect it to?

Source Link
Thomas
  • 5.1k
  • 21
  • 71
  • 101

Problem with Jquery addClass

So Im new to javascript and I am having trouble implementing the jquery .addClass() effect.

The script I am trying to use looks like this:

<script>
    $(function(){   
        $('#top_right_size_large').click(function(){
            $('#primary').addClass('large_content');
        });
    });
    </script>

I've looked at the documentation and checked all of my parenthesizes but for whatever reason this doesn't add the .large_content class when the #top_right_size_large anchor is clicked. Any ideas why this wouldn't work the way I expect it to?