您的位置:首页 > Web前端 > JavaScript

JavaScript练习题目(1)按钮改变文本域值

2012-03-20 00:00 519 查看
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>My First Script</title>
<script type="text/javascript">
function test() {
var temp = document.getElementById('input_text');
temp.value = '哈哈';
}
</script>
</head>
<body>
<form>
<label>输入</label><input id="input_text" type="text" value="默认值" />
<input type="button" value="设置为'哈哈'" onclick="test();" />
</form>
</body>
</html>


$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});

原文链接:
http://blog.csdn.net/poechant/article/details/6975006
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: