jquery如何获取div里面value的值以及原生写法

admin3年前前端技术1311

jquery写法

$(this).attr("value")

原生写法

var value = document.getElementById(""+id+"").getAttribute("value")

相关文章

让TD 与div自动换行的css方法

word-wrap: break-word;  word-break: break-all; white-space: normal;...

原生javascrip 复制功能

兼容chrome FIrfox IE 下载地址000.zip代码如下:<!DOCTYPE html> <html> <head> &nbs...

通过jQuery Ajax使用FormData对象上传文件,实现uedito文本编辑器独立上传单个图片的功能

FormData对象,是可以使用一系列的键值对来模拟一个完整的表单,然后使用XMLHttpRequest发送这个"表单"。在 Mozilla Developer ...

jquery默认设置第一个类的css或者属性

var me=$("#cima>input");me.eq(0).css...

ios 手机端 input 框上方有内阴影

解决方案1:<!--如果 ui 样式里有边框,可以用外层盒子设置边框-->input{     border:none; }...

Navigate down the menu through jquery development

The core knowledge is to use jquery's hover method to achieve, The animation effe...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。