How to target a variable's child with JQuery
How do I target post_ad_cloned's input child?
var post_ad = $('.duplicate_name');
var post_ad_cloned = post_ad.clone().removeClass('duplicate_name').appendTo('#sss').show();
$("po开发者_如何学运维st_ad_cloned input").css('color', 'red');
var post_ad = $('.duplicate_name');
var post_ad_cloned = post_ad.clone().removeClass('duplicate_name').appendTo('#sss').show();
$("input", post_ad_cloned).css('color', 'red');
or:
var post_ad = $('.duplicate_name');
var post_ad_cloned = post_ad.clone()
.removeClass('duplicate_name')
.appendTo('#sss')
.show()
.children('input')
.css('color', 'red');
精彩评论