Tag: Saat
Program JavaScript Untuk Mendapatkan URL Saat Ini
Contoh: Dapatkan URL Saat Ini // program to get the URL const url1 = window.location.href; const url2 = document.URL; console.log(url1); console.log(url2); Keluaran https://www.google.com/ https://www.google.com/ Pada program di atas, window.location.href properti dan document.URL properti digunakan untuk mendapatkan URL halaman saat ini. Keduanya window.location.href dan document.URL properties mengembalikan URL halaman saat ini.
Read more »Program Javascript untuk Menampilkan Tanggal Saat Ini
Contoh : Menampilkan Tanggal Saat Ini // program to display the date // get local machine date time const date = new Date(); // get the date as a string const n = date.toDateString(); // get the time as a string const time = date.toLocaleTimeString(); // display date console.log(‘Date: ‘ + n); // display time […]
Read more »