Hi...
I'm trying to write object-oriented style javascript as follows:
-
function HtmlFormUtil(formId){
this.formId=formId;
this.dirtyInputs=new Array();
}
HtmlFormUtil.prototype.trackForChanges=function(){
$(":input","#"+this.formId).change(function(){
Hi all,
I have a code that counts the number of rows in a table...
the table looks like:
...
and my jquery looks like:
$("#myTable tbody:first-child tr").length;
strange enough that always returns 0.
but if i remove the thead from the
tbody)
>
> Cheers,
> David
>
>
>
> Alex Wibowo wrote:
>
>> Hi all,
>>
>> I have a code that counts the number of rows in a table...
>>
>> the table looks like:
>>
>>
>>
>> ...
>>
>>
>>
>>
sorry i should say
"how does that explain the behaviour when there's no thead" (because it
works when thead doesnt exist)
On Wed, Feb 25, 2009 at 8:06 PM, Alex Wibowo wrote:
> how does that explain the behaviour when there's thead then??
>
>
>
> On
to say is:
>
> $("#myTable tbody tr:first-child")
>
> Which is "select the tr that is the first child of tbody"
>
> http://docs.jquery.com/Selectors/firstChild
>
> Karl Rudd
>
> On Wed, Feb 25, 2009 at 8:08 PM, Alex Wibowo wrote:
> > sorry
parent E. See specs
> at: http://www.w3.org/TR/CSS2/selector.html#first-child
>
> 2-) If you have a thead or/and a tbody in your markup, to select the first
> thead use the pseudo-class :eq instead.
>
> $("#myTable tbody:eq(0) tr").length )
>
> MaurĂcio
>
>
number of rows in the first
> tbody
>
> cheers,
> - ricardo
>
> On Feb 25, 5:25 am, Alex Wibowo wrote:
> > Hi all,
> > I have a code that counts the number of rows in a table...
> >
> > the table looks like:
> >
> >
> >
> >...
> &g
Gday,
Is there a short way to do:
$("#idOne").show();
$("#idTwo").show();
?
So far, my best bet is to do:
$.each(["#idOne","#idTwo"],function(){
$(""+this).show();
});
Thanks in advance!
--
Best regards,
WiB
8 matches
Mail list logo