I’m new to Javascript and I’m try to understand some code. I don’t understand and I can’t find any documentation about the # sign.
$(function () {
$("#searchTerm").autocomplete({
What does $(“#searchTerm”) mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(Note: This answer doesn’t doesn’t start from the premise that the question is asking about jQuery. The addition of the jQuery tag and title edit were not done by the person who asked the question, and who accepted this answer).
In JavaScript? Nothing special. It is just part of a string.
The
$function might do something with it, but it is hard to tell what the$function is.There are a lot of libraries which provide a
$function that acts as a kitchen sink for that library. They include Prototype, Mootools and jQuery. This one looks most like jQuery, in which case the argument is a string containing a CSS selector, so the#indicates the start of an id selector.This "Selects a single element with the given id attribute".