是否有与< noscript>相反的HTML? [英] Is there a HTML opposite to <noscript>?

查看:116
本文介绍了是否有与< noscript>相反的HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML中是否有标签,只有启用了JavaScript才会显示其内容?我知道< noscript> 的工作方式相反,当JavaScript关闭时显示其HTML内容。但是,如果JavaScript可用,我只想在网站上显示一个表单,告诉他们为什么他们不能使用表单,如果他们没有它。



我知道如何做到这一点的唯一方法是在脚本标记中使用 document.write(); 方法,并且对于大量的HTML似乎有点麻烦。 / p>

解决方案

您可以在页面加载时通过JavaScript显示一个隐形div。


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.

这篇关于是否有与&lt; noscript&gt;相反的HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆