How to hide an element to be toggled with jquery while maintaining progressive enhancement
问题 All the answers I could find recommended adding display:none to css... but for a user without javascript, they will never see the element. jQuery(document).ready(function($){ $('#toggleElm').hide(); $('#toggleBtn').click(function(){ $('#shareLink').slideToggle(); }) }); still results in an element that appears and disappears during page load because the page begins rendering before the DOM has finished these days. <script type='javascript'> document.write("<style type='text/css'> #toggleElm