1
目前在使用jquery刪除強標籤方面存在一些小問題。通過jquery從jquery刪除嚴格強大/粗體的文本標籤
我想保留強大的標籤之間的文字,所以如: 前:
<strong>This is a text</strong>
後:
this is a text
和代碼:
$("div.row.ordertype").each(function(){
if(($(this).text()).length>0){
console.log($(this).html());
var test = $("<strong>","<strong />").contents().unwrap();
console.log(test);
}
})
任何想法
這工作。非常感謝。不知道爲什麼我被拒絕了,因爲這個問題包含了所有必要的信息:/ –
@MubeenHussain - 不客氣! – adeneo