Home  >  Article  >  Web Front-end  >  jsp网页搜索结果中实现选中一行使其高亮_javascript技巧

jsp网页搜索结果中实现选中一行使其高亮_javascript技巧

WBOY
WBOYOriginal
2016-05-16 16:59:531514browse

我在做搜索结果时,为了好看需要将选中的行变的高亮些,我使用了一个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()+"");
out.println(""+Info.getAssetsName()+"");
out.println(""+Info.getAssetsClass()+"");
out.println(""+Info.getCgTime()+"");
out.println(""+Info.getGbTime()+"");
out.println(""+Info.getConfigInfo()+"");
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn