jQuery可见性过滤选择器:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>jQuery可见性过滤选择器</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> </head> <body> <form id="form1"> <div> 第一层</div> <span style="display: none;">Hidden</span> <input type="button" id="btn" value="显示" /> </form> <script src="/demo/js/jq.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $('#btn').click(function () { //$('span:hidden').addClass('class1').show(); $(':hidden').addClass('class1').show(); //$('div:visible').addClass('class1'); $('div:visible').addClass('class1'); }) }) </script> </body> </html>
网友评论文明上网理性发言 已有0人参与
发表评论: