JS Implementation input button is never available to become available

Source: Internet
Author: User

Sometimes it is very simple things, because some of their own carelessness, may be in that circle has been around for a long time to go round.

So I would like to write these very simple stupidity, with June share ~

First of all, you know that <input> has a type named "button", which is visible or not determined by the "disabled" attribute.

The following code, I originally intended to be an input box and three buttons. Before clicking the "Edit" button, the other three are "not available" status, click on the back to be usable.

"Content-type"Content="text/html; Charset=utf-8"><title>insert title Here</title><script type="Text/javascript">function edit () {document.getElementById ("Editcode"). Disabled =true; document.getElementById ("Invitecode"). Disabled =false; document.getElementById ("Randomcode"). Disabled =false; document.getElementById ("Submitcode"). Disabled =false; }</script>"Ten"> <tr> <th> Current invitation code:</th> <td><input type="text"Name="Invitecode"Id="Invitecode"Value="" class="input"Size="6"Disabled/></td> <td><input type="Button"Name="Randomcode"Id="Randomcode"Value="Random Access"disabled/></td> </tr> <tr align=" Right"> <td><input type="Button"Name="Editcode"Id="Editcode"Value="Edit"onclick="edit ()"/></td> <td><input type="Submit"Name="Submitcode"Id="Submitcode"Value="Determine"disabled/></td> </tr> </table> </s:form></body>

It is simple to set the disabled type of each element to be available or unavailable in the edit () function.

I met a big problem in the middle that I always thought I was looking for the solution is not available, that is, I named the element "edit", "submit" and so on, may have some content with itself conflict. Error after reviewing element: object is not a function.

After renaming everything to be resolved.

JS Implementation input button is never available to become available

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.