通过本文主要向大家介绍了jquery,text()等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
要注意的当然是我等jquery菜鸟.$.text()获取的是所有匹配元素的text,要注意的是$.text(val)会把里面的所有东西都删了(包括里面的html标签)再设置text,相当于$.html(val)。官方的说法是“Set the text contents of all matched elements.Similar to html(), but escapes HTML (replace "<" and ">" with their HTML entities).”。