Grow your CSS skills. Land your dream job.

Tiny jquery help

  • # May 6, 2013 at 5:51 am

    Hi, everyone
    There’s two link A and B if A is clicked, I want other one to change it to be green. Here’s what i have done but it’s not working.
    http://jsfiddle.net/Lhkn6/5/

    # May 6, 2013 at 6:00 am

    You’re mixing up syntaxes, either use `.css(property, value)` or `.css(Object with property: value pairs)`

    $(“#linka”).click(function() {
    $(“#linkb”).css(“color”,”green”);
    });

    or

    $(“#linka”).click(function() {
    $(“#linkb”).css({“color”:”green”});
    });

    # May 6, 2013 at 6:01 am

    Two things wrong here. First, you didn’t have a jQuery library selected (it was set to “No-library”). Second, remove the curly brackets around the part where you set the color. Result: http://jsfiddle.net/senff/Lhkn6/7/

    Edit: ….and what Crocodillon said. :)

    # May 6, 2013 at 6:34 am

    Thanx a lot senff and Croc. Thanx once again!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".