[jQuery] manipulating like normal DOM
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 (I have to confess, I've used lots of prototype where I
could do $(string).disabled = 'disabled';)
so I changed it to document.getElementById(string).disabled =
'disabled', and this worked, but it didn't feel good.
Is there another way, am I supposed to use the $.attr perhaps?
like
$('#'+string).attr('disabled', 'disabled');
and is attr the way to get all the attributes of dom element, would
seem so :)
this does seem to be the case, just wanted to ask and receive best
practice
Andreas
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/