Home >Web Front-end >JS Tutorial >Select a line to highlight it in jsp web search results_javascript skills

Select a line to highlight it in jsp web search results_javascript skills

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

When I was making search results, I needed to highlight the selected row to make it look better. I used an onclick event:

Copy code The code is as follows:

var assno="";
function check(obj,che,rwid){
if(obj.checked==true){
document.getElementById(rwid).style.background ="blue";
assno=document.getElementById(che).value;
alert(assno);
}
}

This is the dynamically generated html code in the web page:
Copy the code The code is as follows:

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