代码如下:

var elements=$(".myclass");
//length>0则说明获取到了元素对象,否则未获取到 if(elements.length>0)){ alert("exist"); } else{ alert("not found"); }

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-01-05
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-06-02
  • 2021-05-28
相关资源
相似解决方案