Is parent a form

Description

The following code shows how to verify if parent is a form.

Example


<html>
<head>
<script
  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {<!--from   ww w.  j a  va2  s. c o  m-->
    alert($(":checkbox").parent().is("form"));
  });
</script>
</head>
<body>
  <form>
    <input type="checkbox" />
  </form>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities