Home > Software design >  how to add a remove icon to file uploading in html forms
how to add a remove icon to file uploading in html forms

Time:07-04

I developed a form for file uploading. now I want to add a remove icon to remove the uploaded file in UI. please provide me a solution with remove the function. Thank you.

        <div >
            <label >attachment</label>
            <div >
                <input type="file"  id="file" name="file"><br><br>
            </div>
        </div>

CodePudding user response:

if using bootstrap 5 :
add file bootstrap-icons.css

<div >
    <label >attachment</label>
    <input type="file"  id="file" name="file" />
    <button  type="button"><i ></i></button>
</div>
  • Related