如何选择文件上传? [英] How to cancle select file upload ?
问题描述
大家好,我想在点击按钮之前选择一个图像并预览图像上传,我可以做到但已经完成但是我希望有一个事件cancle通过点击 或点击按钮,它可能看起来像在Facebook上附加图像的帖子状态,所以我不知道如何制作它,我会尝试使用按钮重置,但它不符合要求。我希望收到一些建议或指导,感谢阅读。
Hello every one, I want to select a image and preview an image before I click button Upload, I can do it and it done but I want to have a event cancle select this file by click on or click on button, it may be look like post status with attach image in facebook, so I don't known how to make it, I will try use button reset but it don't accordance with required. I hope to recieve some advice or guide to make it, thank for read.
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<label for="avatar">Select Image:</label>
<input id="avatar" name="avatar" type="file">
<a href="">Click to cancle Select</a>
or
<input type="button" value="Click to cancle Select" /></button>
</body>
</html>
这是图片演示
http://i1095.photobucket.com/albums/i472/OLAKEN91/ji_zps58ebae06.png
Here is picture demo
http://i1095.photobucket.com/albums/i472/OLAKEN91/ji_zps58ebae06.png
推荐答案
您可以参考以下链接取消所选图像。
http://jsfiddle.net/jonathansampson/dAQVM/ [ ^ ]
You can refer following link to cancel the selected image.
http://jsfiddle.net/jonathansampson/dAQVM/[^]
这篇关于如何选择文件上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!