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
Issue with Email reporting in Windows SBS 2008
Microsoft Outlook 2007 is pulling duplicate emails from free hotmail live server - how can I prevent this, its driving me mad.
Enumerable or Strongly typed List of Guids
iPhone Active sync with exchange server
swf file won't play on the web
2GB of RAM laptop only recognizing 1GB
trying to print to HP laserjet 2050 - and constantly have to hit "ok" button to print
Problem getting the Selected value of a CheckBoxList (used in a gridview)
Update HP onboard administrator SSH version?
Updating a Data Set that has been returned from a Function or DLL