<html>
<body>
<p id="demo">Click the button to display the formatted number.</p>
<button onclick="myFunction()">Try it</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>