求 关于只读文本框的代码

来源:百度知道 编辑:UC知道 时间:2024/09/27 11:51:51
一个只读文本框 右边有单选的 radio单选框 选中单选框,只读文本框中显示单选框的内容
求代码 jsp JavaScript html都行 谢谢。

单选框的内容?什么意思啊?单选框有什么内容?
是不是这个意思啊?单击单选按钮,文本框中出现单选框的
value
以下代码测试通过
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function show(src){
document.getElementById("target").value = src.value;
}
</script>
</head>

<body>
<input type="text" readonly="readonly" id="target" /><input type="radio" value="aaaaaaa" onclick="show(this)" />
</body>
</html>