When you click table row (student name), the corresponding layer (student information) is displayed. when you click another row, the original layer is hidden.

Source: Internet
Author: User
When you click table row (student name), the corresponding layer (student information) is displayed. when you click another row, the hidden problem of the original layer is displayed. Click table row (student name) the corresponding layer (student information) is displayed. when other rows are clicked, the original layer is hidden and the corresponding layer is displayed. Problem: The table & lt; tr & gt; has the onclick function to implement the display layer. how to make a table row (student name) that hides the layer when onblur loses focus) the corresponding layer (student information) is displayed, and the hidden problem of the original layer is displayed when other rows are clicked.
Effect: When you click table row (student name), the corresponding layer (student information) is displayed. when you click another row, the original layer is hidden and the corresponding layer is displayed.
Problem: TableWith onclick, the display layer can be implemented. how can I hide the layer when onblur loses focus.
Code:
JavaScript:
JScript code
  Function ShowChosen (divID) {divID. style. display = 'block'; div = divID;} function selectRow (rowID) {var tStu = document. getElementById ("tblStudent") for (var I = 0; I
  


Table:
HTML code
  
  



Layer:
HTML code
  
          " style="display:none">        
  

Note: previously, we used single-choice button groups, ShowChosen () for onclick, HideChosen () for onblur, but wanted table effects, and single-choice buttons could not be hidden;
The original idea is that in selectRow (), HideChosen () is used when the row is not vertex, but HideChosen ( ); It cannot be used, and the face value in the brackets.

Thank you very much!

------ Solution --------------------
Why not use jquery?

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.