Effect:
1. If the parent node is selected, all the following child nodes are selected.
2. If the parent node is not selected, all the following child nodes are not selected
3. If one child node is selected, the parent node is selected.
4. If all child nodes are not selected, the Father's Day node is not selected.
<% @ Page language = "java" import = "java. util. * "pageEncoding =" UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %> <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
Note: In this example, the prop () method is used to obtain node attributes. It cannot be used with attr ., Jquery 1.6 has changed these two methods. attribute indicates that DOM state information is obtained from the document, and properties indicates the dynamic state information of elements, such as the use of check boxes.