A simple page, with the button:
<button id="MyButton">Hello</button>
The problem is:
A simple Jquery:
$('#MyButton').hide();
Isn't sufficient as the button 'flickers', it loads and then hides itself and it's very noticeable.
The one way I've found to make this work is by using JS to hide it immediately after:
<button id="MyButton">Hello</button>
<script>
document.getElementById('MyButton').style.visibility = 'hidden';
</script>
This seems a bit ugly and breaking a couple of good standards rules, is this the only way to hide the button without a flickering effect?
Sounds like a job for the noscript tag!
<noscript>
<button id="MyButton">Hello</button>
</noscript>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With