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

admin4年前前端技术1756

jquery写法

$(this).attr("value")

原生写法

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

相关文章

让javascrip函数内的局部变量能为全局使用的方法

<script type="text/javascript">   var mine;  function&nbs...

Navigate down the menu through jquery development

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

jquery中把字符串转成数字

jquery里把字符串转换为数字,用的是js,因为jquery本身就是用js封装编写的,比如我们在用jquery里的ajax来更新文章的阅读次数或人气的时候,就需要用到字符串转换为数字的功能了,先来看...

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

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

发表评论    

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