Prev Demo
JavaScript
>
Parse Strings
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to parse a string.</p> <input type="button" onclick="myParsing()" value="Parse"> <p id="myId"></p> <script> function myParsing() { var A = parseFloat(15) + "</br>"; var B = parseFloat("15") + "</br>"; var C = parseFloat("1/2") + "</br>"; var D = parseFloat("20.5") + "</br>"; var E = parseFloat("15 20.5") + "</br>"; var F = parseFloat(" 100 ") + "</br>"; var G = parseFloat("I spent 5 days") + "</br>"; var R = A + B + C + D + E + F + G; document.getElementById("myId").innerHTML = R; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output