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).”。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3