Hello boys and girls,
I want to create multiple toggle buttons to open and close specific window popups using 1 code.
Button1 opens window1, when pressed again it closes window1, button2 opens window2, when pressed again it closes window2, etc.
What i need is to set a variable window name depending on wich button is pressed so the button that opens the window also closes that specific window only.
the code below is as far as i am but doesn't work as explained above.
<input type="button" value="OFF" id="Window1" onclick="toggle('Window1')">
<input type="button" value="OFF" id="Window2" onclick="toggle('Window2')">
popout = window.open("URL",id,"settings");
My question is:
Can "popout" be set as a variable set by the pressed button and how can i recall it?
With kind regards,