![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jquery
pang_sanbai
这个作者很懒,什么都没留下…
展开
-
实现div切换
js代码: .switchD为页面上的点击事件触发元素 $(document).ready(function(){ $(".switchD").click(function(){ var sIndex = $(this).index()+1; var switchId = $($(this).parent()).attr("id");原创 2016-08-04 14:19:52 · 265 阅读 · 0 评论 -
jquery中attr和prop的区别
jquery中attr和prop的区别 http://www.cnblogs.com/Showshare/p/different-between-attr-and-prop.html 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这些问题就出现了。 关于它们两个的区别,网上的答案很多。这里谈谈我的心得,我的心得很简单:转载 2016-08-04 16:11:46 · 206 阅读 · 0 评论 -
jq html,text和val的区别
html 能够添加像、等标记 text 只能写文本,标记会以文本形式输出 val 是属性,只有有该属性的对象才能调用(如textarea)原创 2016-08-04 16:43:22 · 246 阅读 · 0 评论 -
javascript 转换 \ 为 \\
javascript 正则表达式转换 $('str').html().replace(/\\/g,"\\\\"); 如果是Java的话: 传给java后台识别成\\就要: $('str').html().replace(/\\/g,"\\\\\\\\")原创 2016-08-11 18:36:23 · 605 阅读 · 0 评论