javascript - Count of items with having common name (different index in the middle as Name) -


i have record on list , displayed on page. named like

name="detaillist[0].category" name="detaillist[1].category" name="detaillist[2].category" 

how able count number of elements having name. "detaillist[x].category" note: can't use id . because using jsp , automatically set name when declared them using logic:iterate.

var countelements = $('[name^="detaillist["]').filter('[name$="].category"]').length; 

this give elements names starting "detaillist[" , ending "].category" not match name="detaillist[2].foo" example


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -