/** hasAttr
** helper plugin returning boolean if the first element of the collection has a certain attribute
**/
$.fn.hasAttr = function(attr) {
return 0 < this.length
&& 'undefined' !== typeof attr
&& undefined !== attr
&& this[0].hasAttribute(attr)
}
var offORonlinePath="../img/"; //We can easy to change the path anytime
var extension=".webp"; //we can later change any value like png,jpg,...
$("img[data-src]").each(function(){
var imgName=$(this).data("src");
$(this).attr("src",offORonlinePath+imgName+extension);
})