Refer above image , how to clear "Koala.jpg" file name, each time when user hits a delete button , inside a bootstrap modal.
$('#delImg').on({
click: function() {
$('#fileupload').attr("value", "");
$('#fileupload').attr("src", "");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="modal-body">
<div class="box-body">
<form method="post" action="#">
<div>
<textarea id="" ng-model="" style="" class="textarea" placeholder="Post something"></textarea>
</div>
</form>
</div>
<div class="form-group">
<label for="exampleInputFile">File input</label>
<input type="file" id="exampleInputFile">
<div id="imgdispy"></div>
<p class="help-block">Example block-level help text here.</p>
</div>
</div>
<button type="button" id="delImg" class="btn btn-default btn-hover-green" data-action="save" data-dismiss="modal" role="button">Delete</button>
</div>
The above code isn't working
After some google search , clearing cache can be the solution , but need help in understanding syntax and the real cause.