JQuery

Get filename of image jQuery?

Get filename of image jQuery?, someone asked me to explain?

In this tutorial I will show you how to get the filename of the image using jQuery.  Split the path of the image using the slash('\') and get the filename with some logic.

<img id="Preview" src="~/Uploads/preview.jpg" alt="Preview..." />
var preview =document.getElementById('Preview');

var src=     preview.src.split('/');
var filename = src[src.length- 1];

get filename of image jQuery

Post your comments / questions