Sorry I see that the comments don't line up well, thought I'd re-write
the code such as to simplify reading the comments:
// select all the cells with class "mychkbox" :
$("td.mychkbox").each(
// apply the mousedown event to each one of these :
function(){
$(this).bind(
"mousedown",
// (and here $(this) is correctly referring to those cells
// because the mousedown event is triggering correctly on all of
them)
function(){
if (allchecked.attr("checked")==false){
// only if allchecked is NOT checked, do such n such.
// Now what I need to do here is get the "checked" state of the
// checkbox which is a child of the table cell.
// If I do:
var itsme = this;
// this seems to get the table cell, in fact:
alert(itsme);
// gives me [object HtmlTableCellElement]
// But I can't seem to access any of the attributes of the table cell
// let alone the children.
alert(itsme.name);
// gives "undefined"
// or:
var itsyou = itsme.attr("name");
alert(itsyou);
// gives no results, it actually stops everything from working.
// or:
var itsyou = eccomi.find("input:checkbox");
alert(eccoti);
// gives no results, it actually stops everything from working
}
});
});
Hmmm... I'm stumped, I can't access the child checkbox, much less the
child checkboxes "checked" value.
Anyone have any ideas?