有时候在html中自定义属性能够方便我们,比如<span id='span1' time='2008-8-8'>hello</span>,通常在ie中获取time的办法是:document.getElementById('span1').time就行,但是这个方法在firefox下不管用,兼容的做法是这样的:
document.getElementById('span1').attributes['time'].nodeValue;
相关文章:
-
2022-12-23
-
2018-05-06
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-02-27
-
2021-11-22
猜你喜欢
-
2021-06-10
-
2021-11-09
-
2022-12-23
-
2022-12-23
-
2021-12-27
-
2022-12-23
相关资源
-
下载
2023-04-06
-
下载
2023-01-21
-
下载
2022-12-08
-
下载
2023-02-09