How to change the argument of a function in a onclick property on a <img> tag?
<p>So, I call a function inline inside an img tag onclick, and when it performed its task, I want that function call to change the second property of a function inside another img tags onclick property, the only way I can think of doing that is reading the onclick property's string, scanning from the right for the first ' to appear, reading everything till the next ' into a variable and change that.</p>

<p>Here's my javascript</p>

<pre><code>function hideShow(x,y) {
    var hide = document.getElementById(x);
    var show = document.getElementById(y);
    if (!hide.classList.contains("display-none") &amp;&amp; show.classList.contains("display-none")) {
        hide.classList.add("display-none");
        show.classList.remove("display-none");
    } else {
        hide.classList.remove("display-none");
        show.classList.add("display-none");
    }
}
</code></pre>

<p>And the html</p>

<pre><code>&lt;img src="img/label1.png" class="cursor-pointer" onClick="hideShow('label1','label2')" id="label1"&gt;
&lt;img src="img/label2.png" class="cursor-ponter display-none" onClick="hideShow('label2','label3')" id="label2"&gt;
&lt;img src="img/label3.png" class="cursor-pinter display-none" onClick="hideShow('label3','label1')" id="label3"&gt;
</code></pre>

<p>Now I wish I knew a more simple way of changing the second argument of the function inside the first img-tags onclick-property to 'label3', when I click the third img.</p>