The main advantage of using the closure function for explicit and hidden content is to increase the display and hiding efficiency.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta name = "Generator "CONTENT =" EditPlus "> <meta name =" Author "CONTENT =" "> <meta name =" Keywords "CONTENT =" "> <meta name =" Description "CONTENT = ""> <style type = 'text/css '>. a {width: 200px; font-size: 12px; font-weight: bold; height: 30px; line-height: 30px; background: url (/images/default/header_bg.gif ); Margin-top: 5px ;}. a {text-Decoration: none ;}. aa {width: 200px; height: 100px; border: 3px groove # 91D2FF; display: none ;} </style> </HEAD> <BODY> <p id = "a" title = "a1" class = 'A'> + Click to display </p> <p id = "a1" class = 'aa' style = 'display: block'> love and worry-free, my idol is fruit </p> <p id = "B" title = "b1" class = 'A'> + Click to display </p> <p id = "b1 "class = 'A'> carefree, fruit I worship you, don't worry, fruit I worship you </p> <p id = "c" title = "c1" class = 'A'> + Click Show </p> <p id = "c1" class = 'A'> no worries about love and care about baby fruits every day, pay attention to the image fruit every day </p> <p id = "d" title = "d1" class = 'A'> + Click to display </p> <p id = "d1" class = 'A'> carefree, love Fruit, love fruit, Love Fruit </p> <script language = "JavaScript"> <! -- Var Each = function (a, fn) {for (var I = 0; I SCRIPT </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]