javascript - HTML - document.write
问题描述
我是 html 新手。当我单击“Lol Me”按钮时,我的以下代码网页变为空白?而不是“大声笑”。下面的代码有什么问题。
<html>
<body>
Hi there<br>
<script>
var x = "John said, \"Boy this is good\"";
var y = true;
function write(){
document.write('LOL');
}
function funcy(){
alert('Trozan virus');
}
</script>
<input type="button" value="press me" onclick="funcy()">
<input type="button" value="Lol me" onclick="write()">
</body>
</html>
问候, 巴努
解决方案
推荐阅读
- graphql - 用户未定义 Express-GraphQl 错误
- python - 从函数中获取变量的问题
- python - python variable float format #ValueError: 格式说明符缺少精度
- blazor - Blazor On Parent 单击然后检查子复选框
- python - 查找和替换不变的列表
- python - 如何使用 serializers.py 中的密码字段 ..password2=serializers.Charfield(serializers.widget=PasswordInput()) 在使用时不起作用
- c# - 内存消耗什么?
- python - 如何在包 __init__.py 文件中处理导入?
- azure-active-directory - Azure AD B2C 声明转换
- android - 我什么时候应该更喜欢顶级 const 与伴随对象 const?