<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script language="JavaScript">
function Setvalue(itemid, vl){
document.getElementById(itemid).value = vl;
}
</script>
</head>
<body>
<input id="heating" />
<BR>
<a href="javascript:void(0);" onclick="Setvalue('heating', innerHTML);">Gas Central Heating</a>
<a href="javascript:void(0);" onclick="Setvalue('heating', innerHTML);">Electric Central Heating</a>
<a href="javascript:void(0);" onclick="Setvalue('heating', innerHTML);">Storage Heating</a>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script language="JavaScript">
function Setvalue(itemid, vl){
document.getElementById(itemid).value = vl;
}
</script>
</head>
<body>
<input id="heating" />
<BR>
<a href="javascript:void(0);" onclick="Setvalue('heating', innerHTML);">Gas Central Heating</a>
<a href="javascript:void(0);" onclick="Setvalue('heating', innerHTML);">Electric Central Heating</a>
<a href="javascript:void(0);" onclick="Setvalue('heating', innerHTML);">Storage Heating</a>
</body>
</html>
解决方案 »
- SCRIPT438 和 SCRIPT257
- 关于jquery弹出框fancybox的问题
- 关于js脚本错误有4个疑问
- 在一个select的选中某值时,触发另外一个select为可操作状态
- 选择文件路径窗口的问题。熟悉JQuery或JavaScript的朋友请进来。
- 一个关于JQuery的问题,求解……
- 执行ActiveXObject("ADODB.Stream")需要什么条件吗?
- 求助!使用JS脚本,以SAX2方式解析XML文件?
- 怎么让让一段js代码随网页加载自动运行,应该把这段代码放在那里呢?
- 求助,如何在微信浏览器中统计用户访问页面的时长?
- 请问这个JS盖怎么些
- 请问如何将数字转成货币格式
function Setvalue(itemid,obj)
{
var ele = event.srcElement;
document.getElementById(itemid).value=ele.innerText;
}
</script>
<input id="heating" /><a href="javascript:void(0)" onclick="javascript:Setvalue('heating')">Gas Central Heating</a>
function Setvalue(itemid)
{
var ele = event.srcElement;
document.getElementById(itemid).value=ele.innerText;
}
</script>
<input id="heating" /><a href="javascript:void(0)" onclick="javascript:Setvalue('heating')">Gas Central Heating</a>