dgbullar Posted June 3, 2007 Share Posted June 3, 2007 HI everyone,This question may seem simple to most of you but I can't quite figure it out. So here it is:I want to have a window that will display an image and under the image will be a button that will close the window. How would I make the button close the window?I also want to create the button icon myself as opposed to using the browses default button, how would I insert my icon?Thanks for any help on this,David B Link to comment Share on other sites More sharing options...
jesh Posted June 3, 2007 Share Posted June 3, 2007 You could use a regular link with an image in it: <a href="#" onclick="CloseWindow();"><img src="theimage.gif" alt="Close" /></a><script type="text/javascript">function CloseWindow(){ // Can only close windows that have been opened by another window. // So, you have to check to see it this window has an opener. if(window.opener) { // It does, so let's close the window. window.close(); }}</script> Link to comment Share on other sites More sharing options...
System Posted June 11, 2007 Share Posted June 11, 2007 I have no idea if this works, but I found it in my HTML book I am learning from so I figured I would post it... <form><input type='button' value='Close Window'onClick='self.close()'></form> Sorry if this doesn't help at all,System Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.