日期:2014-05-16 浏览次数:20355 次
<html>
<head>
<title>更改链接</title>
</head>
<body>
<form>
<input id = "txt_cap01" type="text" value="">
<input id = "txt_ref01" type="text" value="http://www.baidu.com">
<input type="button" id="btn_add" value="添加链接">
</form>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(
function(){
$("#btn_add").click(
function(){
var ref_add = document.getElementById("txt_ref01").value
var cap_add = document.getElementById("txt_cap01").value
document.write("<a href = '" + ref_add + "'>" + cap_add + "</a>");
}
);
}
);
</script>
</body>
</html>
<html>
<head>
<title>更改链接</title>
</head>
<body>
<form>
<input id = "txt_cap01" type="text" value="">
<input id = "txt_ref01" type="text" value="http://www.baidu.com">
<input type="button" id="btn_add" value="添加链接">
<p> </p>
</form>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(
function(){
$("#btn_add").click(
function(){ &n