jQuery is such a powerful, and fun, language to learn. There may be some situations where the same class is used on multiple objects, and there may be cases where you only want to target one particular type of objects despite the same class being used multiple times.
For example:
Just some example content
</div>
jQuery has an awesome way of differentiating from the two above examples, despite not having an ID and both having the same class:
Here we are targeting any td that has the class “contentheading” and changing the css colour of it! We can then even extend this to target items inside the object for example:
You may not even know if the td object exists with this class name though, so you can do something like:
//no td with the class "contentheading" on this page
}
Interesting read! I often find situations where I need to do something and only jquery can save the day.
Only jQuery can save the day in my book. I just love this language, its so easy and fun to use, right?
Great post as usual. Well I expect nothing less from Timby’s Tech Talk. I can just simply copy the codes right off Timby’s post, awesome!