If you search after ids it is allways document.getElementById()
because the id must be uniq!
So it is the fastest!!! way to find an element!
jQuery code:
// HANDLE: $("#id")
else {
var elem = document.getElementById( match[3] );
// Make sure an element was located
if ( elem ){
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id != match[3] )
return jQuery().find( selector );
// Otherwise, we inject the element directly into the jQuery
object
return jQuery( elem );
}
On 2 Okt., 11:33, Pedram <[EMAIL PROTECTED]> wrote:
> how could we say this cause the Engine must search all the Document to
> Find the #C ....
>
> On Oct 2, 12:24 pm, BB <[EMAIL PROTECTED]> wrote:
>
> > $("#c").val(); would be the best and fastest!
>
> > On 2 Okt., 10:38, Pedram <[EMAIL PROTECTED]> wrote:
>
> > > Dear folk
> > > consider the Below HTML Code
>
> > > <div id="a">
> > > <p id="b">
> > > <input type="text" id="c" />
> > > </p>
> > > </div>
>
> > > I would like to have Input selecter
> > > there are some ways which one has more speed and it is efficient
>
> > > 1- $("div#a p#b :text#c").val();
> > > 2- $("#a #b #c").val();
> > > 3.$("#c").val();
> > > 4-$(":text#c").val();
> > > 5-$(#a).children().children().val();
> > > and .....
>
> > > Regards Pedram