Count total number of textbox using Jquery

Forums jQueryCount total number of textbox using Jquery
Staff asked 3 years ago

I have to count total number of textboxes available in a HTML page using textbox

Answers (3)

Add Answer
Nishant Kakadiya Marked As Accepted
Staff answered 3 years ago

For total number of textboxes count in HTML Page

$(‘input[type=text]’).length

For total number of visible textboxes count in HTML Page

$(‘input[type=text]:visible’).length

Staff answered 3 years ago

You can use,

$("input:text").length

Staff answered 3 years ago

For counting the total number of textbox available in the HTML you can use following techniques:

jQuery:

$('input').length

JavaScript:

document.querySelectorAll('input').length

Hope this helps you.

Subscribe

Select Categories