Re: [JS] js一個簡單的程式
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' type='text/javascript'></script>
<script type="text/javascript">
function get_respon(object)
{
var pre=object.previousSibling.previousSibling;
var string=document.getElementById(pre.id).value;
$("div#result").append(string);
}
</script>
</head>
<body>
<input type='text' id='respon' value='response'/>
<input type='submit' onclick='get_respon(this);'/></br>
<div id="result"></div>
</body>
</html>
--
我成功了!!
感謝N大指點~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.127.200.211
推
09/09 15:30, , 1F
09/09 15:30, 1F
→
09/09 15:31, , 2F
09/09 15:31, 2F
→
09/09 15:51, , 3F
09/09 15:51, 3F
→
09/09 15:52, , 4F
09/09 15:52, 4F
推
09/09 19:06, , 5F
09/09 19:06, 5F
→
09/09 19:07, , 6F
09/09 19:07, 6F
→
09/09 19:07, , 7F
09/09 19:07, 7F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
2
5
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章