fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <p id="demo">单击按钮来显示格式化的数字</p> <button onclick="myFunction()">点我</button> <script> function myFunction(){ var num = 15; var a = num.toString(); var b = num.toString(2); var c = num.toString(8); var d = num.toString(16); var n=a + "<br>" + b + "<br>" + c + "<br>" + d; var x = document.getElementById("demo"); x.innerHTML=n } </script> </body> </html>
运行结果