I have the following code:
<html>
<head>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<span></span>
<div class="content" id="2">
<div class="reply"></div>
</div>
<div class="content" id="1">
</div>
<div class="content" id="3">
<div class"reply"></div>
</div>
<script>
var n = $( ".reply" ).length;
$( "span" ).text( "There are " + n + " divs.");
</script>
</body>
</html>
I am trying to write a jQuery script that will check individual divs with unique id's to see if it contains the "reply" div. I have code to see if the "reply" div exists at all working. I am new to jQuery so I am unsure how to go about this.
var n = $( ".reply" ).length;
$( "span" ).text( "There are " + n + " divs.");