Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to close tab by 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
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery change span tag text 
Javascript :: next js next/head head 
Javascript :: react localstorage 
Javascript :: how to access vuex state properties with getters in nuxt vuex 
Javascript :: how do you remove a remove element from array in javascript 
Javascript :: jquery number format comma 
Javascript :: Node Sass version 5.0.0 is incompatible with ^4.0.0. 
Javascript :: ^(?:(+|00)d{1,3}[-s.])?(()?d{3,10}())?(?:[-s.)]d{2,7}([-s.]d{2,5})?([-s.]d{2})?)?$ 
Javascript :: state wheteher true or false The charioteer sprinkled sacred water on the king. 
Javascript :: widget is not working in arcgis map javascript 
Javascript :: externalCodeSetup.navigationApi.replaceScreenComponent 
Javascript :: js throw error 
Javascript :: react conditional classname 
Javascript :: commas for thousands js 
Javascript :: c# json foreach key value 
Javascript :: multi-stage Dockerfile for Node.js 
Javascript :: json opposite of stringify 
Javascript :: json decode in jquery 
Javascript :: how to close modal using esc key in nuxt js 
Javascript :: react-native-render-html link click 
Javascript :: how to serve build react 
Javascript :: react native set default ios simulator 
Javascript :: change version of node mac 
Javascript :: convert file into base64 in javascript 
Javascript :: play store rejected app due non-certified ads SDK 
Javascript :: node mailer office 365 
Javascript :: horizontal scroll onclick react 
Javascript :: datatables hide showing entries 
Javascript :: inline style boarder radius jsx 
Javascript :: how to change link href with javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =