更新时间:2021-08-25 18:18:59
var selector = ":input[type=text]:first";
var str = $(selector).clone().wrap('<div/>').parent().html();
更新您无需担心拨打 .parent()
因为您正在使用原始选择器的孤立克隆。
Update You don't need to worry about calling .parent()
since you're working with an orphaned clone of the original selector.