HTML/Javascript remove data from img src attribute

 

To clear the img src attribute using JavaScript, the following approaches can be utilized:

 

document.getElementById('tst').removeAttribute('src');

 

Another way

document.getElementById('tst').setAttribute('src', '');

Tags:

Share:

Related posts