<script> alert($('#newFields input').size()); </script> <span id = "newFields"> <input type = "text"> <input type = "text"> <input type = "text"> <input type = "text"> <input type = "text"> </span>