function popaste(){var c=window.clipboardData.getData('text'); c=c.trim();
carray=c.split(" ");
$$("postcode").value=carray[0];
$$("postcode2").value=carray[1];
}
以上是将粘贴的内容分别赋予两个input,分别为postcode和postcode2,但是完了以后光标还在postcode处,希望光标自动往下跳,就是跳到postcode2以后再跳一个, 我试了直接加一句event.code=9不行啊
<input id="ll1" name=""type="text" value="value" />
<script language="javascript" type="text/javascript">
window.$=function(str){
return document.getElementById(str);
};
function btnKeyPress(){
var maxlen=parseInt($("ll2").getAttribute("maxlength"));
if(parseInt($("ll2").value.length)===maxlen){
$("ll1").focus();
}
}</script>