Orkal3 Posted November 24, 2007 Share Posted November 24, 2007 I'm not that good in JavaScript, so I need a script that closes the window by pressing a button. Can anyone help? Link to comment Share on other sites More sharing options...
Ingolme Posted November 24, 2007 Share Posted November 24, 2007 try <input type="button" onclick="window.close();" value="Close window" /> Link to comment Share on other sites More sharing options...
Synook Posted November 24, 2007 Share Posted November 24, 2007 Btw, that will only work on windows that mave been initially opened by JavaScript (e.g. through window.open() ). Otherwise, depending on the browser, either the client will be prompted or nothing will happen. Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted November 26, 2007 Share Posted November 26, 2007 Many websites have it setup so that you click a link to close. Take this for example <a href="#" onClick="java script:window.close();>Close window</a> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.