Microsoft
Software
Hardware
Network
Question : jquery selector basic question
Hi, I know that jquery selector accepts CSS syntax etc. I am puzzled however by this
example for going through each column:
Why in $('th', $table) we need a comma and then $table object ?
Would not be enough just to put $('table th') ?
or just $('th') ?
$(document).ready(function
() {
$('table.sortable').each(f
unction() {
var $table = $(this);
$('th', $table).each(function(colu
mn) {
var $header = $(this);
if ($header.is('.sort-alpha')
) {
$header.addClass('clickabl
e').hover(
function()
{
$header.addClass('hover');
}, function() { ...
$header.removeClass('hover
');
Answer : jquery selector basic question
FYI: when you do this:
$('th')
internally, jquery actually "executes":
$('th', document);
that's why you would get all the th in the document.
Reference:
http://docs.jquery.com/%24
Random Solutions
Black marks over the text of some PDF docs in adobe reader (like hightlights).
What is the proper DNS settings for ...
Creation of RAID device fails
JQuery based image (actually an element of code) rotator
Loopback adaptors on routers??i want to know its all benefits/uses
Why is my border not wrapping around all of my content in firefox??
Grid inline editing
How can I get an email to release its hold on an attachment after sending?
How to open new pdf window using struts ?
How can I tied up a JQuery event after a Postback?