0

I'm just trying to reset my css, this doesn't seem to work although it follows the same structure detailed here: http://www.w3schools.com/jquery/css_css.asp

function labelReset(){
    $(".year").css("color" : "#000", "opacity" : "0.5", "size" : "14px");
    $(".dot").css("background-color" : "#000", "width" : "7px", "height" : "7px");
};

any thoughts?

1
  • 1
    W3Schools is generally crap. If you want to know about the jQuery syntax, go directly to the jQuery docs. Commented Jul 7, 2012 at 10:19

1 Answer 1

3

You forgot to use brackets {}:

   function labelReset(){
        $(".year").css({"color" : "#000", "opacity" : "0.5", "size" : "14px"});
        $(".dot").css({"background-color" : "#000", "width" : "7px", "height" : "7px"});
    };

For single property: .css( propertyName, value ), for multiple properties: .css( map ), check jQuery API css.

Sign up to request clarification or add additional context in comments.

1 Comment

ah I was confused slightly by their one bracket example, thanks very much guys

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.