jquery 检测元素是否存在的实例代码
发布时间:2016-12-30 来源:查字典编辑
摘要:if($('#myDiv).length){//yourcode}Simple,butnotobvious.
if ($('#myDiv).length) {
// your code
}
Simple, but not obvious.
if ($('#myDiv).length) {
// your code
}
Simple, but not obvious.