I have a banner on my website that by default is not shown. The code I am using to get it to show is
document.getElementById("cookie1").style = "display:block;"
This works in Chrome but is not working in safari. I am not getting any errors in Safari either, It just doesn't show the banner.
Any ideas on what could be causing this? Or a better way to hide/show a page element?
Thanks!
From testing this in Chrome and Safari, it seems Chrome is more forgiving in that it parses the style string and puts the right style in place for you, but Safari does not.
Try:
It's probably best to be explicit like that anyway, instead of relying on string parsing for the style itself.