we can change the attributes of elements. For example, we can change the src attribute of an image. JS
var el = document.getElementById("myimg");
el.src = "https://www.sololearn.com/Images/home-new/1073.png";
HTML
<img id="myimg" src="https://www.sololearn.com/Images/home-new/1068.png" alt="" />
Note: Practically all
attributes
of an element can be changed using
JavaScript
by Valeri Tandilashvili
4 years ago
JavaScript
DOM
2
Pro tip: use ```triple backticks around text``` to write in code fences