title: change the position of image on click
body: <pre><code>   &lt;html&gt;
     &lt;head&gt;
     &lt;script type="text/javascript"&gt;
     function changepic()
     {
     document.getElementById("demo").style.top=2000;  
     }
     &lt;/script&gt;
      &lt;/head&gt;
     &lt;body&gt;
  
   &lt;h1&gt;My First Web Page&lt;/h1&gt;
    &lt;div id="demo"&gt;
    &lt;img src="./omna.jpg"  style="position:absolute; left: 400; top: 100; width: 200;      height: 200;"/&gt;
    &lt;/div&gt;
    &lt;button type="button" onclick="changepic()"&gt;change pic&lt;/button&gt;
    &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>
  
  <p>Why im unable to change the position of picture whats going wrong ?</p>
  
  <pre><code>&lt;img id="demo"&gt; ' google says it works
  </code></pre>
  
  <p>I dont know but the above html page isnt working I wanted to change the position of an image when I click the button, please help me with these. Im using google chrome</p>
  
  <pre><code>&lt;img onclick="somefunc()"&gt; can I set function onclick to image also? right?
  </code></pre>
  
  <p>But its not working please help me with the html Code!</p>