JavaScript triggers the Input-file click event

Source: Internet
Author: User
Overview
  • The input:file itself is not very good-looking, but it is impossible to set the style.
  • Due to system limitations, it cannot be triggered by code and only allows users to click independently.
  • The usual solution is to make input:file transparent, actually clicking or Input:file.
Scheme
  • Although it can be implemented with CSS in the overview, it always occupies a position.
  • The following trigger events are implemented via JavaScript, and a simple line of code is done: D
    1 <body>2   <input type= "File" id= "Demo" >3   45    

    Although I am not a button, but you click my words, can trigger upload Oh, 6 <br>7 P.S: Even if Input:file is hidden, it can. 8 </body>

JavaScript triggers the Input-file click event

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.