Ví dụ
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <button onclick="myFunction()">Run</button> <p id="demo"></p> <script> function myFunction() { var content = '14Hello - ' + parseFloat('14Hello') + '<br>'; content = content + ' 999 - ' + parseFloat(' 999') + '<br>'; content = content + '555-444 534 - ' + parseFloat('555-444 534') + '<br>'; content = content + '.555-444 534 - ' + parseFloat('.555-444 534') + '<br>'; content = content + '14.5Freetuts - ' + parseFloat('14.5Freetuts') + '<br>'; content = content + ' freetuts.net - ' + parseFloat(' freetuts.net') + '<br>'; content = content + '...555 - ' + parseFloat('...555') + '<br>'; document.getElementById("demo").innerHTML = content; } </script> </body> </html>
PHÓNG TO