Add to the end of the attribute For example:

<img src="" alt="тест в начале"> 

and when you click to make it so

 <img src="" alt="тест в начале строка конец"> 

    1 answer 1

    On pure JS:

     document.getElementById('imgID').alt += ' строка конец'; 

    On jQuery:

     var old = $('#imgID').attr('alt'); $('#imgID').attr('alt', old + ' строка конец')