document.write() example
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style type="text/css"> #result{ color: red; font-size: 20px; font-weight: bold; } </style> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p id="result"></p> <button onclick="myFunction()">Xem kết quả</button> <script> function myFunction(){ var x = document.URL; document.write( alert('Hi! everyone'), "-Hello freetuts.net") } </script> </body> </html>
PHÓNG TO