![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
动态增加的html jQuery选择不了
动态增加了一个inputclass为pickerjQuery$(".picker").colpick({layout:'hex',submit:0,colorScheme...
动态增加了一个input class为picker
jQuery
$(".picker").colpick({
layout:'hex',
submit:0,
colorScheme:'dark',
onChange:function(hsb,hex,rgb,el,bySetColor) {
$(el).css('border-color','#'+hex);
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
if(!bySetColor) $(el).val(hex);
}
}).keyup(function(){
$(this).colpickSetColor(this.value);
});
求解默认文档里面存在的就可以,动态增加的就不可以。 展开
jQuery
$(".picker").colpick({
layout:'hex',
submit:0,
colorScheme:'dark',
onChange:function(hsb,hex,rgb,el,bySetColor) {
$(el).css('border-color','#'+hex);
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
if(!bySetColor) $(el).val(hex);
}
}).keyup(function(){
$(this).colpickSetColor(this.value);
});
求解默认文档里面存在的就可以,动态增加的就不可以。 展开
2017-06-07
展开全部
用jquery的on方法,手册上有
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询