this is driving me nuts…
The button is supposed either to make the square invisible or visible
The function ‘visibility’ gets its target from the button´s/element´s dataset (data-mytarget)
The function ‘visibility’ works, but not on the first click (though the console shows the target element incl. it´s display-status on the first click)
From the second click forward it works perfectly…
Where´s my mistake…?
Thanks in advance, Kalle
display.zip (14.6 KB)