Difference between getElementById and jquery $('#smth')

前端 未结 4 1490
猫巷女王i
猫巷女王i 2020-12-29 21:19

What\'s the difference between classic Javascript code:

document.getElementById(\'theID\')

and the jQuery version:

$(\'#the         


        
4条回答
  •  悲哀的现实
    2020-12-29 21:43

    Well in your second project, you might not have included the jQuery files at the the top.

提交回复
热议问题