JSFiddle - React, Tailwind, and code Playground

by SANDEEP VIRANI

HTML

<input class="file_upfile" type="file" />
<input class="btn_showpath" type="button" value="Show Full Path"/>
<p class="p_upfilepath">Full path will display here. (currently display only file name)<p>

CSS

.p_upfilepath{
    background:#aaaaaa;
    padding:3px 10px;
    width:auto;
    color:#555555;
}

JavaScript

/* Here <p> show only file name, I want a full path of file like
   "c:\something\folder\filename.txt"   */

$('.btn_showpath').click(function(){
    var getpath = $('.file_upfile').val();
    $('.p_upfilepath').slideUp(function(){
        $('.p_upfilepath').text(getpath).slideDown();
    });
});