I have this little FIDDLE to exemplify my problem.
HTML
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
<h1>"I have " + count + " list items"</h1>
JAVASCRIPT
var count = 0;
$("li").each(function(){
count++;
});
The variable count
of JavaScript will have the number of li
's ul
.
How do I get the h1
variable to appear in count
of HTML?