标签:
<a id="aa" href="#" onclick="atype(‘bb‘,‘aa‘)">普通</a>
<input type="hidden" id="bb" name="aa" value="" />
<script>
var typei = 0;
function atype(typeid,atypeid){
typei++;
if(typei%2==‘1‘){
document.getElementById(typeid).value=document.getElementById(atypeid).innerHTML;
}else{
document.getElementById(typeid).value=‘‘;
}
}
</script>将普通赋值给id为a1的input
用途如下:
标签:
原文地址:http://www.cnblogs.com/langxi/p/4437025.html