* Michael Geary <[EMAIL PROTECTED]> [2006-11-21 16:16]:
> > I've just begun using jquery, and wanted to set the disabled 
> > attribute on a input element. I have a string with an id 
> > value, and so I thought $('#'+string).disabled = 'disabled'; 
> > would cut it, but it seems I can't access normal DOM 
> > attributes just like that...
> 
> $() returns a jQuery object, not a DOM element. The jQuery object is an
> array of DOM elements (even if there's only one). So when there's a single
> element, you can get a reference to the element with:
> 
> $(whatever)[0]
> 
> In your example, you can use:
> 
> $('#'+string)[0].disabled = 'disabled';

I'm doing this...

// get the height of the element with the id item

var h = $("#item").get(0).offsetHeight

...or this...

// get the maximum hight of all elements with the item class

var h = 0
$(".item").each(function() { if (this.offsetHeight > h) h = this.offsetHeight })

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
                Think New Orleans - http://thinknola.com/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to