How to change all elements with the same IDs javascript/html? : <p>I will be working on a table and wanted to change one column with different img src icon.</p>

<p>Here's my sample code:</p>

<p>Html</p>

<pre><code>&lt;img src="" id="mytext"&gt;
&lt;img src="" id="mytext"&gt;
&lt;img src="" id="mytext"&gt;
</code></pre>

<p>Javascript</p>

<pre><code>var test = "https://www.datatables.net/media/images/nav-dt.png";
document.getElementById("mytext").src = test;
</code></pre>

<p>When i run this it only changes the src of the first instance.
How can i change them all?</p>
