日期:2014-05-16 浏览次数:20345 次
function aa(){ var cr = document.getElementById("car_route").innerHTML; for(i=0;i<cr.length;i++){ var s = cr.split("")[i]; document.getElementById("route").value=s; }
function aa(){ var cr = document.getElementById("car_route").innerHTML; var str=''; for(i=0;i<cr.length;i++){ var s = cr.split("")[i]; str+=s; } document.getElementById("route").value=str; }
------解决方案--------------------
var num=0; function aa(){ num++; var cr = document.getElementById("car_route").innerHTML; if(num>cr.length) return; var str=''; for(i=0; i<num; i++){ var s = cr.split("")[cr.length-i-1]; str+=s; } document.getElementById("route").value=str; }