A ‘$’ in a variable means nothing special to the interpreter, much like an underscore.
From what I’ve seen, many people using jQuery (which is what your example code looks like to me) tend to prefix variables that contain a jQuery object with a $ so that they are easily identified and not mixed up with, say, integers.
The dollar sign function $()
in jQuery is a library function that is frequently used, so a short name is desirable.
Related Posts:
- Should Python class filenames also be camelCased?
- Failed to load resource: the server responded with a status of 404 (Not Found)
- What is NODE_ENV and how to use it in Express?
- How to deal with net::ERR_SSL_PROTOCOL_ERROR?
- What is the way of declaring an array in JavaScript?
- How to disable JavaScript in Chrome Developer Tools?
- Reactjs – Form input validation
- What is event bubbling and capturing?
- Angular: mat-form-field must contain a MatFormFieldControl
- JS – ReferenceError: fetch is not defined
- Check if a variable is a string in JavaScript
- How can I add a key/value pair to a JavaScript object?
- How to change css property using javascript
- JavaScript get element by name
- How do I disable right click on my web page?
- Left() function in Javascript or jQuery
- JavaScript Loading Screen while page loads
- Why is “forEach not a function” for this object?
- Completely disable scrolling of webpage
- How to Open New window on every Click
- Jquery Ajax Call, doesn’t call Success or Error
- How to create a stopwatch using JavaScript?
- How does += (plus equal) work?
- Javascript Comparison Operators != vs !==
- onEnter not called in React-Router
- Find the largest palindrome made from the product of two 3-digit numbers – Javascript
- Javascript/Jquery Convert string to array
- How to interpolate variables in strings in JavaScript, without concatenation?
- Embedding instagram webpage inside an iframe
- Do something if screen width is less than 960 px
- How to add a keyboard listener to my onClick handler?
- Javascript – Replace html using innerHTML
- Syntax error: Illegal return statement in JavaScript
- Error: TypeError: $(…).dialog is not a function
- Bootstrap modal – close modal when “call to action” button is clicked
- Correct modification of state arrays in React.js
- Angular 2 Sort table columns
- JavaScript string encryption and decryption?
- How do I programmatically set the value of a select box element using JavaScript?
- Validating Custom Meta Box Values & Required Fields
- How to dequeue a script?
- How to use wp_localize_script in custom page template?
- How do I make my wordpress page more friendly for mobile viewers?
- Check javascript file Proper way in functions.php
- preserve url parameters from affliliate sites
- Making a custom widget that includes a tinymce and works in Site Origin Page Builder
- How to overwrite JS variable with wp_localize _script?
- Execution of JavaScript on save post
- What’s the better way to add an inline script?
- How to get value of selected page template in Gutenberg editor?
- How to speed up admin-ajax.php in wordpress
- JQuery not working on WordPress Admin page [closed]
- What javascript libs & frameworks are integrated in WordPress vanilla?
- Conditional fields in contact form 7 not working
- Why is my javascript not invoked in my hooks except wp_head?
- Why won’t my scripts load?
- Ajax Modal Flickers When Opened Multiple Times
- Enqueueing a script and a style sheet not working
- AngularJS with route and JSON API
- Uppload image from another source wp.media
- Status 400 for AJAX POST Request with admin-ajax.php
- Use onfocus event in Contact Form 7
- Get Block Attributes in JSON REST API
- Static page to one page- menu inactive items highlighted
- Performance optimization of tree like structure
- Generate sidebar depending on height of post
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- How to properly Remove certain CSS / JS files from template
- how do i in ignore/disable/delete a javascript call from parent in child theme?
- “Conflict” with jQuery (or its plugins)?
- url – ajax loaded but no JS
- enqueue script won’t work (enqueue style does work)
- Variable equals another variable and then equals another variable
- in jquery read a multidimensional array via wp_localize_script()
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- The correct way to add a JavaScript in the functions.php [closed]
- get db values for external js file
- Ajaxurl suddenly not defined
- Social share buttons text shows up on post excerpts
- How would I create the same popup in css and javascript as the one in contact button on the site https://www.sublimotionibiza.com/es/main.html [closed]
- Plugin Admin panel checkbox unchecked after submit
- How to get file object from file_attachment?
- Creating a brand attribute as a variable
- How do I load urls from an external .js file to my admin head?
- Creating a User-Adjustable chart in WordPress
- Javascript not getting injected into page
- Why does my custom plugin only function correctly once per page?
- Where is the Javascript attribute window._wpCustomHeaderSettings defined?
- How to execute WP shortcode in a javascript string “”
- WordPress Customizer: Check for value of CSS selector and replace it
- Jquery wrap permalink in a data-attribute?
- Trouble with adding preloader to my home page index.html and index.js
- Creating custom URL for async content
- JS files landing on page but not working, using childtheme of twentyeleven
- Why this plugin is not working?
- Enqueue script throws error in console
- Replacing & in JS code on pages
- javscript that updates div in a single wordpress page
- How can I use AJAX in child theme template?
- WordPress enque the same script causes the setInterval not to work