一、如果是已经声明存在的变量或者对象,就不用加引号。

  比如var name=document.getElementById("name");

  $(name)或者$(this)。

二、document、this、window 这些都是系统对象   可以直接使用, 所以不用加引号。

三、加引号的一般是元素标签有id、class这些,用$("xx")的方式获取这些元素用的。

 

相关文章:

  • 2022-12-23
  • 2021-09-08
  • 2021-12-09
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
相关资源
相似解决方案