spikes 0 Junior Poster

Hi All,
Can any one give me the code for closing a browser window.

function closewindow() {

     if (newwindow && !newwindow.closed) {

            newwindow.close()

            }
   }



<input type="button" value="close" onclick="javascript: closewindow()">

this is what i have and it dont work. also, just a point, the first time i used javascript was yesterday, so please explain the obvoius as thats probably what i'm missing here.

cheers

spikes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.