title: Javascript onclick event to increase and decrease width
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myFun(img) {
    img.style.width = "200px";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;img src="images/img.jpg" id="test" width="100px" heigh="100px" onclick="myFun(this)"&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>So the code is when I click the image, the width increases by <code>100px</code>. What I wanted to achieve is that when I click the image again I wanted it to regain its actual width i.e <code>100px</code>. How to do so?...
  Thank You.</p>