change fill colour using javascript

Discussion in 'Web Design and Development' started by mbpowner, Nov 27, 2016.

  1. mbpowner macrumors regular

    Joined:
    Aug 19, 2016
    #1
    how do you change the fill colour of a class/id using javascript? I only found how to background colour with js /jquery which both dont seem to wor...

    thanks
     
  2. 960design macrumors 68020

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #2
    Many ways... but this is a simple to understand way.

    Create two css classes. One is red, the other white.
    Switch the class on a button press or programatically, based off of a scroll, click or timed event.

    If you post a link to your code in something like JSBin. We could specifically show you were you messing up.
    Good luck!
     
  3. iPaintCode macrumors regular

    iPaintCode

    Joined:
    Jun 24, 2012
    Location:
    Metro Detroit

Share This Page