[jQuery] Re: document.getElementById shortcut?

2008-11-23 Thread Erik Beeson
jQuery isn't a replacement for javascript. If you want document.getElementById, use it. If you want a shorter name, shortcut it yourself. If you want to get the DOM node out of a jQuery object, use $(...)[0] --Erik On Sun, Nov 23, 2008 at 9:34 PM, George <[EMAIL PROTECTED]> wrote: > > I found mys

[jQuery] Re: document.getElementById shortcut?

2008-11-23 Thread Michael Geary
The jQuery shortcut is: $('#myid')[0] If you want something faster and have no need for jQuery operations, then of course you can use document.getElementById directly, or wrap it in your own function: function whatever( id ) { return document.getElementById(id); } I don't think I'd recommend c

[jQuery] Re: document.getElementById('elid') != $('#elid') ?

2007-11-25 Thread Karl Rudd
The jQuery $ "function" returns a "wrapper" type object, which acts like an array, even if there's only one object in it. So you can do: sel = $('#product_id_01'); sel[0].options.length = 0; Karl Rudd On Nov 26, 2007 6:33 AM, kitsched <[EMAIL PROTECTED]> wrote: > > I was trying to populate a s

[jQuery] Re: document.getElementById

2007-04-10 Thread Sean O
Fabyo, Try: var teste = $("#obj"); alert(teste.scrollTop); You need the "#" prefix to designate an id. (and a "." prefix for class) Native elements, like body, can be directly addressed ( e.g. $("body") ) ___ SEAN O http://www.sean-o.com Fabyo wrote: > > it functions