81,092
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script type="text/JavaScript">
function aaa(){
var a = "李 伟";
document.getElementById("cxtj").innerHTML= " <a href='#' onclick='bbb('" + a + "')'> 测试 </a>";
}
function bbb(a){
alert(a);
}
</script>
<body >
<table align="center">
<tr>
<td>
<div id ="cxtj">
</div>
<input type="button" onclick="aaa()" value="点击"/>
</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script type="text/JavaScript">
function aaa(){
var a = "李伟";
document.getElementById("cxtj").innerHTML= ' <a href="#" onclick="bbb(\''+a+'\')"> 测试 </a>';
}
function bbb(a){
alert(a);
}
</script>
<body >
<table align="center">
<tr>
<td>
<div id ="cxtj">
</div>
<input type="button" onclick="aaa()" value="点击"/>
</td>
</tr>
</table>
</body>
</html>