當我做搜尋結果時,為了好看需要將選取的行變的高亮些,我使用了一個onclick 事件:
var assno="";
function check(obj,che,rwid){
if(obj.checked==true){
document.getElementById(rwid).style.background ="blue";
assno=document.getElementById(che).value;
alert(assno);
}
}
這是網頁中動態產生的html程式碼:
out.println("
| ");
out.println("" Info.getAssetsNo() " | ");
out.println("" Info.getSerialNo() " td>"); out.println(" |
" Info.getAssetsName() " | ");
out.println("" Info.getAssetsClass() " | ");
out.println("" Info.getCgTime() " | ") ;
out.println("" Info.getGbTime() " | ");
out.println("" Info.getConfigInfo() " | ");