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 :: js check if infinity 
Javascript :: react how to scroll to element 
Javascript :: how to clone a object in javascript angular 
Javascript :: how to append more elements after click in react 
Javascript :: Javascript remove array item by value 
Javascript :: how to check if window size of browser s changed javascript 
Javascript :: insertone mongoose 
Javascript :: get top n objects from list node js 
Javascript :: save things javascript 
Javascript :: add an element to the front of an input list in javascript 
Javascript :: angular reactive input required based on previous value 
Javascript :: cursor to pointer in react 
Javascript :: demo json data 
Javascript :: object get property with max value javascript 
Javascript :: how to sort a populated data in mongoose 
Javascript :: javscript .split().reverse.join 
Javascript :: float js precision 
Javascript :: expo android built is huge 
Javascript :: Setting object properties in C# from Javascript code 
Javascript :: drm react native 
Javascript :: js remove quotes from string 
Javascript :: javascript absolute value 
Javascript :: onclick change text color javascript 
Javascript :: js iterate array index 
Javascript :: console.log red text on yellow background 
Javascript :: javascript get diagonals of array 
Javascript :: Codewars Square(n) Sum 
Javascript :: CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker" 
Javascript :: query params in next js 
Javascript :: jquery is checked 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =