onClick=window.close()

or if the window needing to be closed is the window currently being used: onClick=self.close() or just onClick=close()