css - jQuery change background with <input type="range"> -


How are you,

I've read myself a little basic jQuery recently, by doing so I stumbled over the idea of ​​adding a slider to change the background color of my page I have discovered. Click and. CSS parts fix - it works fine with a div, which is incredibly exciting; But I'm having some trouble implementing this using a limit I think that this is just a problem with targeting, but I've put a slight hit on a wall and your help would be much appreciated :)

Dump a demo page here:

Experiment with the page default jQuery library.

Script:

  & lt; Script type = 'text / javascript' & gt; $ (Function () {$ (": Category"). (Function () {$ ("body"). CSS ("background", "red");});}); & Lt; / Script & gt;  

Category:

  & lt; Input type = "category" name = "background_pick" min = "1" max = "5" step = "1" value = "3" /> & Lt; Script & gt; $ (": Range"). Rangeinput (); & Lt; / Script & gt;  

Hope this is quite clear - just tell me if you need more detail.

I'm not sure what you are trying to do here but T does not think the range input Does not have one click event. Change it to change and it works.

  $ (": category"). Change (work () {$ ("body"). CSS ("background", "red");});  

Comments