<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
var main = document.body;
//创建链接
function createa(url,text)
{
var btn = document.createElement("input");
btn.type="button";
btn.value=text;
btn.style.color="red";
btn.style.backgroundColor="gold";
// btn.setAttribute("onclick",window.open(url)); 就是这一行,我的意思是,点击按钮,然后把外面的值传进来,可是把window.open(),“ ”起来的时候,值就传不进去了 该咋整
return btn;
}
main.appendChild(createa("http://www.imooc.com","慕课网"));
</script>
</body>
</html>
qq_青枣工作室_0
路北
if_else_
相关分类