【发布时间】:2012-01-27 08:07:53
【问题描述】:
我无法将用户在文本框中输入的值捕获到变量中。
我不想使用<form>,还有其他方法吗?
<html>
<head>
<style>
p { color:blue; margin:8px; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<input type="text" id="txt_name" />
<script type="text/javascript">
value = $("#txt_name").val();
$("#dom_element").text(value);
</script>
</body>
</html>
【问题讨论】: