Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get input file value to div

Hello i have code below, and I need that i will get file value to <span> "filevalue" but i have no idea how to do that with jquery, so please give me some examples

<div id="file">
    <input type="file" id="ufile"/> 
    <div id="info">
        <span class="filevalue">file value goes here</span>
    </div>
</div>
like image 601
user1861055 Avatar asked Apr 21 '26 21:04

user1861055


1 Answers

$("#ufile").on("change​​​​​​​​", function() {
    $("#info .filevalue").text(this.value);
});​

DEMO: http://jsfiddle.net/A6KEJ/

like image 149
VisioN Avatar answered Apr 24 '26 11:04

VisioN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!