Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <script> function setSpace() { document.getElementById("compman").hspace="50"; document.getElementById("compman").vspace="50"; } </script> </head> <body> <img id="compman" src="compman.gif" alt="Computerman" width="107" height="98"> <p>Some text. Some text. Some text. Some text.</p> <input type="button" onclick="setSpace()" value="Set hspace and vspace"> </body> </html>
Result:
W3Schools.com - Try it yourself