疯子的博客

做一件事,专注一件事
jquery的text()要注意啦
 要注意的当然是我等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).”。

posted on 2009-10-29 23:23  老陈  阅读(542)  评论(1)    收藏  举报