</html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#popup").click(function(){
// pop up a text area and I want to store value of textarea in a variable.
});
});
</script>
</head>
<body>
<form>
<textarea rows="2" cols="20" id="area" style="display:none"></textarea>
<input type="submit" id="popup" value="OK">
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
如何在单击按钮上弹出文本区域?
var textarea = $('#area');
$("#popup").click(function(){
// To show it
textarea.show();
});
// To get the value
var value = textarea.val();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9932 次 |
| 最近记录: |