Select a line in jsp web search results to highlight it
To make the search results better, You need to highlight the selected rows. The following is a good example. For more information, see
I used an onclick event to highlight the selected rows in order to make the search results better:
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 html code dynamically generated on the webpage:
The Code is as follows:
Out. println ("<tr id =" + idrow + "> <td align =/" center/"> <input type =/" checkbox/"onclick =/" check (this, '"+ par +"', '"+ idrow +"');/"/> </td> ");
Out. println ("<td id =/" "+ par +"/"align =/" center/"value =/" "+ Info. getAssetsNo () + "/"> "+ Info. getAssetsNo () + "</td> ");
Out. println ("<td align =/" center/">" + Info. getSerialNo () + "</td> ");
Out. println ("<td align =/" center/">" + Info. getAssetsName () + "</td> ");
Out. println ("<td align =/" center/">" + Info. getAssetsClass () + "</td> ");
Out. println ("<td align =/" center/">" + Info. getCgTime () + "</td> ");
Out. println ("<td align =/" center/">" + Info. getGbTime () + "</td> ");
Out. println ("<td align =/" center/">" + Info. getConfigInfo () + "</td> ");