Prev Demo
JavaScript
>
Object Values To Numbers
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to convert object values to their numbers.</p> <input type="button" onclick="myConvert()" value="Convert"> <p id="myId"></p> <script> function myConvert() { var A = "123"; var B = false; var C = "123 456"; var D = true; var E = new Date(); //* Returns present date and time *// var R = Number(A) + "</br>" + Number(B) + "</br>" + Number(C) + "</br>" + Number(D) + "</br>" + Number(E); document.getElementById("myId").innerHTML = R; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output