What does the '#' sign mean in JavaScript?

后端 未结 8 1093
闹比i
闹比i 2021-02-07 20:48

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 ()         


        
8条回答
  •  [愿得一人]
    2021-02-07 21:24

    That's just a string. The # is just part of a string. I'm assuming the $ is jQuery.

    That means, that the string is a jQuery selector (or rather a CSS selector). The # means "ID". It's searching the DOM for the element with the ID `searchTerm.

提交回复
热议问题