Sublime Text
<!DOCTYPE html> <html> <body> <script> var thanhpho = "Cần Thơ"; var SinhVien = { name:"Nguyễn Thành Nhân", year:1993, city:thanhpho, intro:function(){ document.write("- Tôi tên: " + this.name + "<br>"); document.write("- Sinh năm: " + this.year + "<br>"); document.write("- Sống tại: " + this.city); } } document.write(SinhVien.name + "<hr>"); document.write(SinhVien.year + "<hr>"); document.write(SinhVien.city + "<hr>"); SinhVien.intro(); </script> </body> </html>
<!DOCTYPE html> <html> <body> <script> var thanhpho = "Cần Thơ"; var SinhVien = { name:"Nguyễn Thành Nhân", year:1993, city:thanhpho, intro:function(){ document.write("- Tôi tên: " + this.name + "<br>"); document.write("- Sinh năm: " + this.year + "<br>"); document.write("- Sống tại: " + this.city); } } document.write(SinhVien.name + "<hr>"); document.write(SinhVien.year + "<hr>"); document.write(SinhVien.city + "<hr>"); SinhVien.intro(); </script> </body> </html>