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

Home Forums JavaScript changing css property with javascript

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #35932

    Hellooos so I was actually able to achieve the concept of what i need but not entirely and im to noobish to know where to go from the code i have below.

    what im trying to accomplish is when someone clicks a Link, that it will change a CSS property, and when they click it again, it changes back.. and of course the “Link” doesnt link to another url.. .

    any ideas? thanks!


    sorry, call me lazy but had to try this in jquery

    here you go…hope this works

    Click to toggle


    just update the jquery code…

    // put the id or class you wanted to target
    $(".box1, .box2").click(function () {

    // just copy the id or classes in here
    $(".box1, .box2").toggleClass("highlight");

    here some resources btw…so you can get to know more about jquery , just in case

    – i dont know what are you trying to achieve on this website of yours, can you tell?

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