function convert(frm) {var num num=frm.number.value var dec,bin,oct,hex num=Number(num)
oct=num.toString(8) bin=num.toString(2) hex=num.toString(16) alert(num +"\n binary="+bin+"\noctal="+oct+ "\n hex="+hex)
} //--> </script> </head> <body > <form name="frm">
<input type ="text" name="number"> <input type="button" value="calculate" onclick="convert(this.form)"><br> <form> </body> </html>