js獲取p標籤內容
$("p[name='msg']").text()
$("p[name='msg']").html()
兩者之間的區別,前者獲取p標籤中的內容,後者獲取p標籤中的html
區別就是html()會保留html,text()只有文本內容
js獲取p標籤內容
$("p[name='msg']").text()
$("p[name='msg']").html()
兩者之間的區別,前者獲取p標籤中的內容,後者獲取p標籤中的html
區別就是html()會保留html,text()只有文本內容