jquery text()要注意啦
作者:bea
要注意的当然是我等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 en
要注意的当然是我等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).”。
猜你喜欢
您可能感兴趣的文章:
- 深入认识javascript中的eval函数
- javascript 按回车键相应按钮提交事件
- JQuery 解析多维的Json数据格式
- javascript(jquery)利用函数修改全局变量的代码
- 一个可以兼容IE FF的加为首页与加入收藏实现代码
- JS OOP包机制,类创建的方法定义
- JQuery 网站换肤功能实现代码
- Javascript结合css实现网页换肤功能
- 简单实用的HTML到UBB转换脚本工具实现说明
- cnblogs csdn 代码运行框实现代码
- 键盘 keycode的值 javascript时触发事件时很有用的要素
- js 函数的执行环境和作用域链的深入解析
- 提高网站性能之 如何对待JavaScript
- JavaScript Sort 表格排序
- DOM 脚本编程中的兄弟节点
- javascript GUID生成器实现代码
- JavaScript中的JSON 中文版翻译
- json 实例详细说明教程
- json 入门基础教程 推荐