This code works…
$(document).ready(function(){
$('body').css('background','black');
});
but this code doesn’t…
$(document).ready(function(){
$('thumb_slider').css('background','black');
});
^^^the only thing I’ve changed in the whole code is the id attribute inside the parenthesis. Nothing else at all has been changed.
I do have an html element tag with id=”thumb_slider” and it has text in it that I can see on the screen, but none of my jquery works when I reference an html tag or id other than the body. What am I doing wrong here?
You want ‘#thumb_slider’. It’s the difference between an id and an element name, i.e.:
You select with jQuery in a very similar way to selecting with CSS, so:
body,div,p, etc: select the elements with that name, i.e. of that type.#this,#that: select the element with that specific ID..lots.otherstuff: select the element(s) with that class.