在JAVA中使用js動態(tài)創(chuàng)建控件的方法

字號:

function createCellWithInputOnkeyup(inputType,inputName,inputValue,listid) ...{
    //構(gòu)造td節(jié)點withInput
    //alert(’生成的id:’+listid);
    var cell = document.createElement("td");
    cell.setAttribute("align","center");
    var input =document.createElement("< input style=’text-align:right’ type=’"+inputType+"’ name=’"+inputName+"’ value=’"+inputValue+"’ onkeyup="CountYnse(’"+listid+"’)">");
    cell.appendChild(input);
    //alert(cell.innerHTML);
    return cell;
    }