I know it\'s a silly question but I am a bit confused with this. For example, if I have an input with an ID: rad1
, is there any difference between below lines o
It's only for showing that it's a Jquery variable.
Declaring $a
you're showing that your variable is for JQuery objects, it's just a notation. So the most readable thing will be to declare Jquery variable with $ notation
var $obj=$("#obj");
And DOM element without $ notation
var obj = document.getElementById("obj");