87,901
社区成员
发帖
与我相关
我的任务
分享
head>
<title>无标题页</title>
<script type="text/javascript">
function up()
{
var t=document.getElementById("input").value;
document.getElementById("input").value=parseInt(t)+1;
}
function down()
{
var t=document.getElementById("input").value;
document.getElementById("input").value=parseInt(t)-1;
}
</script>
</head>
<body>
<div id="ss" style="position:relative; padding:0; height:1.2em; width:100px;border:solid 1px blue;">
<input id="input" value="10" style="height:1em; width:80px; padding: 0 2px; position:absolute;border:0px;" />
<a href="javascript:up();" style="position:absolute; right:0px; border:solid 1px blue; height:0.5em;">
<img src="up.jpg" style=" border-width:0px; position:relative;top: -3px; width:20px; height:0.5em" />
</a>
<a href="javascript:down();" style="position:absolute; right:0px; border:solid 1px blue; bottom:0px; height:0.5em;">
<img src="down.jpg" style=" border-width:0px; position:relative;top: -3px;width:20px; height:0.5em" />
</a>
</div>
</body>
<TABLE cellpadding=0 cellspacing=0>
<TR>
<TD rowspan=2><INPUT TYPE="text" NAME="inp" value="0" onfocus="this.blur()"></TD>
<TD><INPUT TYPE="button" VALUE="^" ONCLICK="doit(1)" style="width:20;height:10"></TD>
</TR>
<TR>
<TD><INPUT TYPE="button" VALUE="ˇ" ONCLICK="doit(-1)" style="width:20;height:10"></TD>
</TR>
</TABLE>
function doit(para){
var num = parseInt(inp.value);
inp.value = num + para;
}