jQuery inputfile 自定义按钮,可以删除选择好的内容
![jQuery inputfile 自定义按钮,可以删除选择好的内容 jQuery inputfile 自定义按钮,可以删除选择好的内容](https://i-blog.csdnimg.cn/blog_migrate/7435a39c3559fefc53a1c55dbab90e07.jpeg)
XML/HTML Code
- <div class="wrapper">
- <div class="container">
- <div class="panel">
- <p> The plugin simpley replaces a file input with a button and gives you the ability to remove your selection easily </p>
- <input type="file"/>
- </div>
- <div class="panel">
- <p> You can also load a previously uploaded file and remove it </p>
- <input type="file" data-value="http://www.google.es/" data-text="im_a_file.txt"/>
- </div>
- </div>
- </div>
- <script src="jquery.inputfile.js"></script>
- <script>
- $('input[type="file"]').inputfile({
- uploadText: '<span class="glyphicon glyphicon-upload"></span> Select a file',
- removeText: '<span class="glyphicon glyphicon-trash"></span>',
- restoreText: '<span class="glyphicon glyphicon-remove"></span>',
- uploadButtonClass: 'btn btn-primary',
- removeButtonClass: 'btn btn-default'
- });
- </script>