Home > Web Front-end > JS Tutorial > Problems with the method of obtaining form elements under javascript_form effects

Problems with the method of obtaining form elements under javascript_form effects

WBOY
Release: 2016-05-16 18:35:52
Original
962 people have browsed it
1. Test environment
Browser: IE6, FF 3.5.5, Opera 10, Chrome 4.0.249, Safari 4.0.3

2. Example
Copy code The code is as follows:






Three. Solution (the method I think of is to change the acquisition method, based on YUI) >
Copy code The code is as follows:



document.formname.inputname

I have encountered this problem once before, but I forgot it again this time and made a mistake again, so I must record it.

Look at this example:



Copy the code The code is as follows: < ;form name="hehe">





< script type="text/javascript">
document.write(document.hehe.haha.length);
document.write('
');
document.write( document.hehe2.haha.length);



Demo



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