Default Value clearing and value assignment methods for input file

Source: Internet
Author: User

Most of the 1st methods are traditional, replacing html CodeThe upstairs has been used. I just optimized it with regular expressions;
2nd methods use sendkeys to simulate keyboard operations. You must allow the browser to call ActiveX;
The 3rd method is a bit like "Qian Kun" in martial arts novels! <Input type = "file" value = "C: \ abc.txt"> </P> <p> <button onclick = "clearmethod1 ();"> clear method 1: li daitao </button> <br/> <button onclick = "clearmethod2 ();"> clear Method 2: </button> </P> <p> <input type = "text" value = ""> <input type = "file" value = "C: \ abc.txt "onchange =" this. previussibling. value = This. value; "style =" width: 20 "> </P> <p> <button onclick =" clearmethod3 (); "> clear method 3: sound east to west </button> <br/>

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.