Get total count of textboxes using jQuery

Today,One of my colleague asked me that how to get total number of textbox count using jQuery. This was fairly simple. You can use the length property to get count of textbox. See below jQuery code.

$(document).ready(function() {
    alert($("input:text").length);
});

In this jQuery code, first selecting all the textbox and then taking it's length to get count of total number of textboxes.

See live Demo and Code.

Feel free to contact me for any help related to jQuery, I will gladly help you.



Responsive Menu
Add more content here...