Home > Web Front-end > JS Tutorial > Bug description of getting the value of Button element in IE6 and IE7_javascript skills

Bug description of getting the value of Button element in IE6 and IE7_javascript skills

WBOY
Release: 2016-05-16 18:03:02
Original
1253 people have browsed it

The test code is as follows:

Copy code The code is as follows:


<script> <br>var btn = document.getElementsByTagName('button')[0]; <br>alert(btn.value); <br>alert(btn. getAttribute('value')); <br></script>

IE6/7:

IE8/9/10/Firefox/Safari/Chrome/Opera:

i.e.:

In IE6/7, innerHTML is returned, which is an implementation error.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template