Mega Code Archive

 
Categories / JavaScript Tutorial / JQuery
 

Returns true, because the parent of the input is a form element

< html>   <head>     <script type="text/javascript" src="js/jquery-1.3.2.js"></script>     <script type="text/javascript">         $(document).ready(function(){                    alert( $(":checkbox").parent().is("form"));                              });     </script>   </head>   <body>     <body>           <form><input type="checkbox" /></form>     </body> </html>