DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   $('idname') means what? (http://www.daniweb.com/forums/thread107363.html)

pi415 Feb 2nd, 2008 1:08 pm
$('idname') means what?
 
I cannot find documentation of this anywhere. I am assuming from context that this goes a id lookup of a dom object and returns the object. Is that correct? If someone could point me to documentation of this, I would greatly appreciate it. Thanks,

DangerDev Feb 2nd, 2008 2:03 pm
Re: $('idname') means what?
 
no it didnot return any dom object taking id. if u want to do that u should use getElementById('idname') method of document object.

pi415 Feb 2nd, 2008 3:00 pm
Re: $('idname') means what?
 
OK, I finally found the answer to my own question: Not sure what the best reference is, but here is one that lists some common functions and includes the $(), or if you want to find it via google the dollar function:

http://www.dustindiaz.com/top-ten-javascript/

~s.o.s~ Feb 3rd, 2008 1:32 am
Re: $('idname') means what?
 
From the Ecmascript specification:
Quote:

The dollar sign ($) and the underscore (_) are permitted anywhere in an identifier. The dollar sign is intended for use only in mechanically generated code.
The $() function is not standard javascript and is used by most libraries to stand for the most commonly used function : getElementById().


All times are GMT -4. The time now is 7:27 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC