jquery visible selector
Translation results:
visible
English [ˈvɪzəbl] American [ˈvɪzəbəl]
adj. Visible; obvious, obvious; at hand, available; Perceptible
jquery visible selectorsyntax
Function: :visible selector selects each element that is currently visible. Elements except for the following situations are visible elements: form elements set to display:none type="hidden" Width and height set to 0 hidden parent elements (all child elements are hidden at the same time)
Grammar: $(":visible")
jquery visible selectorexample
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("body :visible").css("background-color","#B2E0FF"); }); </script> </head> <body> <html> <body> <h1>Welcome to My Homepage</h1> <p class="intro">My name is Donald</p> <p>I live in Duckburg</p> <p>My best friend is Mickey</p> <div id="choose"> Who is your favourite: <ul> <li>Goofy</li> <li>Mickey</li> <li>Pluto</li> </ul> </div> </body> </html> </body> </html>
Click the "Run instance" button to view the online instance