<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
用途如下:
时间: 2025-01-13 12:55:50