“cara menutup tab dengan javascript” Kode Jawaban

JavaScript Tutup Tab Saat Ini

window.close();//closes the current browser tab
Grepper

cara menutup tab dengan javascript

// IF you use in a button
<button onclick="window.close();">Exit</button>
// if you use in function
function closeWin() {
  myWindow.close();   // Closes the new window
}
// But it will only work when you open a window through your code like this
function openWin() {
  myWindow = window.open("", "myWindow", "width=200, height=100");   // Opens a new window
}
// You can't close the current window that was open by browser. beacuse browser don't give permission for this
web-noob master

How-to-close-current-tab-in-a-browser-window

Writing this on 24 Dec 2020. Tried almost all the things available on google, but none of them worked in Chrome browser. window.open('','_self').close() works for IE.
Blushing Bird

Jawaban yang mirip dengan “cara menutup tab dengan javascript”

Pertanyaan yang mirip dengan “cara menutup tab dengan javascript”

Lebih banyak jawaban terkait untuk “cara menutup tab dengan javascript” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya