I am calling a javascript function on button click in parent window wherein i am opening a popup window and writing html to it. the popup is created and displaying information correctly. the problem is that if the button in paraent window is clicked again, the information is appended to existing information in popup i.e i have two identical sets, each subsequent click of button adds an extra set. how can i avoid this?