是否有与< noscript>相反的HTML? [英] Is there a HTML opposite to <noscript>?
问题描述
HTML中是否有标签,只有启用了JavaScript才会显示其内容?我知道< noscript>
的工作方式相反,当JavaScript关闭时显示其HTML内容。但是,如果JavaScript可用,我只想在网站上显示一个表单,告诉他们为什么他们不能使用表单,如果他们没有它。
我知道如何做到这一点的唯一方法是在脚本标记中使用 document.write();
方法,并且对于大量的HTML似乎有点麻烦。 / p>
Is there a tag in HTML that will only display its content if JavaScript is enabled? I know <noscript>
works the opposite way around, displaying its HTML content when JavaScript is turned off. But I would like to only display a form on a site if JavaScript is available, telling them why they can't use the form if they don't have it.
The only way I know how to do this is with the document.write();
method in a script tag, and it seems a bit messy for large amounts of HTML.
You could have an invisible div that gets shown via JavaScript when the page loads.
这篇关于是否有与< noscript>相反的HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!