How to populate href value from src value of an image?
<p>I know this is super simple, but I can't work it out (I'm a designer).</p>

<p>I want to simply populate the href attribute value of the <code>&lt;a&gt;</code> tag, with the value of the src attribute of the <code>&lt;img&gt;</code> tag. So the image links to itself basically.</p>

<p>the image src will be updated through a super simple CMS and I want the link to dynamically update, instead of the user having to update the URL also.</p>

<p>I tried something like this, but it didn't work.</p>

<pre><code>&lt;a rel="lightbox[job1]" href="()document.getElementById("gal1_img1").src"&gt;
&lt;img id="gal1_img1" src="images/gallery/job1/image-1.jpg"&gt;`enter code here`
&lt;/a&gt;
</code></pre>
