Firefox does not support the getattribute ("value") manually filled in by input. Value (Firefox 3.5.5 windows) is only supported ). Bug?

Source: Internet
Author: User

Some books use xml dom, getattribute ("value"), and. value.

. Value also complies with W3C standards and belongs to HTML Dom.

 

Environment: Firefox 3.5.5 windows

In Firefox, enter the input element manually and use getattribute ("value") to obtain the entered value.

So we can only use. value. I didn't expect Firefox to have this problem. Does Firefox not support xml dom? Bug?

TestCodeAs follows:

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml" XML: lang = "Yue-Hans-CN" lang = "Yue-Hans-CN">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> it works ...... </title>
</Head>
<Body>
<Form action = "./" method = "get">
<Input type = "text" name = "Address" id = "Address"/>
<Input type = "button" name = "button1" id = "button1" value = "getattribute ('value')" onclick = "alert (document. getelementbyid ('address '). getattribute ('value'); "/>
<Input type = "button" name = "button2" id = "button2" value = ". value "onclick =" alert (document. getelementbyid ('address '). value); "/>
</Form>
</Body>
</Html>

 

 

And this articleArticleCode: http://updatepanel.net/2008/12/31/more-on-getattribute-setattribute-and-the-value-attribute/

 

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "<a href =" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd </a>">
<HTML xmlns = "" http://www.w3.org/1999/xhtml ">
<Head>
<Title> more on getattribute () and setattribute () </title>
</Head>
<Body>
<Input id = "textbox1" type = "text" value = "123"/>
<Input type = "button" value = "alert (element. getattribute ('value'); "onclick =" alert (document. getelementbyid ('textbox1 '). getattribute ('value'); "/>
<Input type = "button" value = "alert (element. Value);" onclick = "alert (document. getelementbyid ('textbox1'). Value);"/>
<Ol>
<Li> <input type = "button" value = "element. setattribute ('value', '20140901'); "onclick =" document. getelementbyid ('textbox1 '). setattribute ('value', '123'); "/> </LI>
<Li> enter 'abc' into the text box. </LI>
<Li> <input type = "button" value = "element. value = '000000'; "onclick =" document. getelementbyid ('textbox1 '). value = '000000'; "/> </LI>
<Li> <input type = "button" value = "element. setattribute ('value', 'xyz'); "onclick =" document. getelementbyid ('textbox1 '). setattribute ('value', 'xyz'); "/> </LI>
</OL>
</Body>
</Html>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.