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 - ' + String('14Hello') + '<br>'; content = content + '123456 - ' + String(123456) + '<br>'; content = content + 'Boolean - ' + String(Boolean(0)) + '<br>'; content = content + 'Boolean - ' + String(Boolean(1)) + '<br>'; content = content + ' Date - ' + String(new Date()) + '<br>'; document.getElementById("demo").innerHTML = content; } </script> </body> </html>
PHÓNG TO