<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the formatted numbers.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<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;
document.getElementById("demo").innerHTML=n;
}
</script>
</body>
</html>