Select a line in jsp web search results to highlight it

Source: Internet
Author: User

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> ");

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.