You can only close windows/tabs that you create yourself. That is, you cannot programmatically close a window/tab that the user creates.
For example, if you create a window with window.open()
you can close it with window.close()
.
More Related Contents:
- 5 stars and the golden 5 stars are not together (When browsing with Internet explorer)
- Get the size of the screen, current web page and browser window
- contenteditable, set caret at the end of the text (cross-browser)
- Browser detection versus feature detection
- OnChange event handler for radio button (INPUT type=”radio”) doesn’t work as one value
- How is the default submit button on an HTML form determined?
- Show datalist labels but submit the actual value
- Jquery load() only working in firefox?
- Is there a way to make text unselectable on an HTML page? [duplicate]
- How to add/update an attribute to an HTML element using JavaScript?
- Prevent zoom cross-browser
- How to make Internet Explorer emulate pointer-events:none?
- textarea character limit
- Enter key press behaves like a Tab in Javascript
- How do I change the ID of a HTML element with JavaScript?
- IE8 alternative to window.scrollY?
- Setting minimum size limit for a window minimization of browser?
- Is there any problem with using HTML5’s “data-*” attributes for older browsers?
- How to make an HTML element editable cross-browser?
- How to detect supported video formats for the HTML5 video tag?
- Testing for multiple screens with javascript
- Retrieving HTML attribute values “the DOM 0 way”
- Use JavaScript to intercept all document link clicks
- Cross-browser innerText for setting values
- jQuery Mobile: Markup Enhancement of dynamically added content
- Javascript – Dynamically assign onclick event in the loop
- javascript code not work in HEAD tag
- ‘img-src’ was not explicitly set, so ‘default-src’ is used as a fallback
- How to determine if user selected a file for file upload?
- How can I get DPI from image in JS?