“Onglet HTML Close” Réponses codées

Onglet JavaScript Close Current

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

Comment fermer l'onglet par 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

Onglet HTML Close

// Closes the tab
window.close();
Ultratiger

Réponses similaires à “Onglet HTML Close”

Questions similaires à “Onglet HTML Close”

Plus de réponses similaires à “Onglet HTML Close” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code