Is it possible to prepend an attribute?

1

I have the following situation: When I request my bank, my <img> tags already come with the src filled attribute, is it possible for me to prepend in it?

For example: <img src="meuArquivo.jpg"> , and via jQuery I insert the previous path to "myFile.jpg"?

I understand something like this:

var meuCaminho = "C:/"
$('img').attr('src').prepend(meuCaminho);

But I do not think it's functional.

    
asked by anonymous 13.01.2016 / 14:23

1 answer

2

You do not need to use prepend .

var imagem = $('img').attr('src');
var meuCaminho = "C:/"

$('img').attr('src', meuCaminho + imagem);
    
13.01.2016 / 14:37