0

say for example I have this code:

function tester($userInput) { this.$userInput1 = userInput; }

Chris Chan
  • 43
  • 3
  • 1
    It is just a variable name. It is convention to generally prepend `$` to jquery objects – Sushanth -- Jul 19 '13 at 00:10
  • This has nothing to do with jQuery. That's JavaScript. It sets the `$userInput1` property of `this` to `userInput`. – Blender Jul 19 '13 at 00:10
  • It's normal JavaScript. You could use it like: `var a = new tester("input")` and `a.$userInput1` which would return `undefined` since `userInput` in your code is not defined :P – Shawn31313 Jul 19 '13 at 00:14

1 Answers1

0

$object doesn't mean anything specific in JavaScript.. its just a variable name. However if you've included the jQuery library, you can use $ to reference the jQuery library, ex: $.ajax() or $('#element_id')

blink-fish
  • 171
  • 17