How Can I Create a Custom File Upload With Only HTML, JS and CSS

后端 未结 4 1795
醉话见心
醉话见心 2021-02-12 15:52

Here is the design of the control I want to create:

\"sample

As you can see, it\'s easy to create

4条回答
  •  时光取名叫无心
    2021-02-12 16:24

    It's actually not as complicated as you may think. Check out this fiddle. Stylize your button how you will!

    HTML

    
    
    

    CSS

    input[type=file] { 
        width: 1px; 
        visibility: hidden;
    }
    

    JavaScript

    $(function(){
        $('#clickme').click(function(){
            $('#uploadme').click();
        });
    });
    

提交回复
热议问题