<html> <head> <script language="JavaScript"> function function1() { document.all.myImage.align = "middle"; } </script> </head> <body> <img id="myImage" src="http://www.java2java.com/style/logo.png" width="74" height="99"> Sample Text <button onclick="function1();">Align Middle</button> </body> </html>