<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title> DOM-XSS TEST </title>
<style>
#box{width:250px;height:200px;border:1px solid #e5e5e5;background:#f1f1f1;}
</style>
</head>
<body>
<script>
window.onload= function(){
var oBox=document.getElementById("box");
var oSpan=document.getElementById("span1");
var oText=document.getElementById("text1");
var oBtn=document.getElementById("Btn");
oBtn.onclick = function(){
oBox.innerHTML = oBox.innerHTML + oSpan.innerHTML + oText.value + "<br/>";
oText.value=""
};
}
</script>
<div id="box"></div>
<span id="span1"> YOU:</span>
<input type="text" id="text1">
<input id="Btn" type="button" value="发送消息" name="">
</body>
</html>
这是源码 然后我将<svg/onload=alert(1)>写入的时候没有成功 <script>alert(1)</script>这样的也不行,请教下各位大佬,问题出在哪里了呀,步骤感觉没有错呀 很苦恼 chorme 火狐 edge 都试过了都不行