variables in jQuery vs Javascript
This question already has an answer here:
You can also have $variable in Javascript. jQuery is just a library that uses $
to make library and non-library functions easier to distinguish.
There is no requirement to prefix jQuery variable names with $. It is merely a convention to indicate that the variable is a jQuery object/collection.
There is no need to do it and seems terrible to use it like this. You are declaring a variable with the name including the $ symbol.
链接地址: http://www.djcxy.com/p/94964.html上一篇: 声明变量javascript