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

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 :: javascript to remove duplicates from an array 
Javascript :: jquery check checkbox 
Javascript :: number of repetition in an array javascript 
Javascript :: javascript tolocaletimestring 
Javascript :: How do I redirect to another webpage 
Javascript :: get offset from timezone javascript 
Javascript :: add event listener on width screen resize 
Javascript :: datepicker strart with monday 
Javascript :: jquery select all checkboxes 
Javascript :: jquery table row count 
Javascript :: js setinterval 
Javascript :: vscode css lint 
Javascript :: react-lottie yarn 
Javascript :: javascript loop through child elements 
Javascript :: javascript run command 
Javascript :: chrome.tab.onupdated 
Javascript :: jquery duplicate last table row 
Javascript :: xmlhttprequest error handling 
Javascript :: force a component to rerender 
Javascript :: concat object 
Javascript :: react font awesome 
Javascript :: vue dynamic route push with params 
Javascript :: concantene number in js 
Javascript :: linker call rect native 
Javascript :: how to change user password firebase 
Javascript :: how to get unique values from array in javascript without duplicate value 
Javascript :: js array add element 
Javascript :: how to trigger on input event in javascript 
Javascript :: MVC 5 controller return json value to view 
Javascript :: currying javascript sum 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =