如何在jQuery中检查元素的存在?
我当前的代码是这样的:
if ($(selector).length > 0) { // Do something }
有更优雅的方式来解决这个问题吗?也许是插件或功能?
javascript jquery
javascript ×1
jquery ×1