js 中 .getAttribute()问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js 中 .getAttribute()问题相关的知识,希望对你有一定的参考价值。

当用户不是通过js修改标签内的属性,.getAttribute()方法拿不到修改后的值:

如在input标签中

<input  id =‘1‘ type="text" name="username" value="请输入用户名" wjz="sss" onblur="func1(this)">

,当用户通过输入框输入的value数据,在onblur 定义的函数中 用.getAttribute()方法拿不到修改后的值,只能通过element.value得到,注意通过“.”的方法获取不到用户自定义属性

以上是关于js 中 .getAttribute()问题的主要内容,如果未能解决你的问题,请参考以下文章

js中的getAttribute方法使用示例

echarts js报错 Cannot read property 'getAttribute' of null

JS之setAttribute和getAttribute

js方法不能与jquery方法同时用

????????????????????????app.js onLaunch???????????????????????????onLoad????????????????????????(代码片

使用node.js中fs模块的copyFileSync方法复制文件报错“operation not permitted, copyfile ‘G: est.txt‘ -> ‘G:Trash‘“(代码片