jQuery inputfile 自定义按钮,可以删除选择好的内容
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>
原文地址:http://www.freejs.net/article_biaodan_222.html