People who have used jquery know that there are two ways to use jquery, one is $ and the other is jquery, so what's the difference between the two?
The answer is that the two methods are no different, just aliases , with $ to be shorter and more convenient than jquery, and other front-end frames are also used in the $ symbol, if you want to not conflict with other frameworks, it is recommended to use the JQuery method.
Another way is to change a new abbreviation:
1. Call the Noconflict function of jquery
Jquery.noconflict ();//Let jquery abandon the use of the $, to other JS framework used
2. Declaring a new abbreviation
Use $J to replace $ to prevent naming conflicts.
The difference between $ and $ ():
$ (' #abc ') is required to invoke methods that do not need to manipulate objects (such as static methods in Java code, which can be manipulated without declaring an object), such as $.prototype, if you assign a value to an object ( Note that there are operands here ). Val (' The 123 '), as the method in Val () will use $ (this) to manipulate the current object.
The difference between $ and jquery and $ () in jquery