Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Tiny jquery help

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44579
    prathoven
    Participant

    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/

    #134204
    CrocoDillon
    Participant

    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”});
    });

    #134205
    Senff
    Participant

    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. :)

    #134202
    prathoven
    Participant

    Thanx a lot senff and Croc. Thanx once again!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.