$('.class input'); //获取class 下的input
$('input .class'); //获取input下的class
$('input .class,.xxx'); //input下的class或xxx类
$('.class input').one('ipnut',function(){})
添加一次性的input事件,输入一个后立刻销毁
$('xxx').one('input',funtion(){
this // 当前选中的对象 js的方法
$(this) //当前对象 jquery方法
$(this).is('.pig') //判断这个对象是否有pig类
$(this).if('div') //判断这个对象是否是div
})
$(document).on("input",".class",function(){});
$('.class').on("input",".class .xx",function(){});
//前面的是父元素 后面的是要选的元素
jquery的$ this $(this) 和one is
最新推荐文章于 2026-06-18 14:51:39 发布
这篇博客探讨了JavaScript中选择器的使用,如$('.classinput')获取class下的input,以及如何通过$('input.class')获取input下的class。同时,讲解了如何使用$.one('input', function() {}

3778

被折叠的 条评论
为什么被折叠?



