Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
62 Points
73 Posts
Mar 02, 2012 11:31 AM|LINK
Hey,
Thx, I tried
$(document).ready(function () { var listObject = $("#<%=lbxUser.ClientID%>"); if (listObject.length > 0) { var arrUser = listObject[0].options; alert(arrUser.length); alert(arrUser.item(50)); } });
So the length equals 692 which would be fine, but if I try to access the item 50 it throws me [object HTMLOptionElement] What am I doing wrong?
Thx!
ronin47
Member
62 Points
73 Posts
Re: Javascript: Getting Content of ListBox
Mar 02, 2012 11:31 AM|LINK
Hey,
Thx, I tried
$(document).ready(function () { var listObject = $("#<%=lbxUser.ClientID%>"); if (listObject.length > 0) { var arrUser = listObject[0].options; alert(arrUser.length); alert(arrUser.item(50)); } });So the length equals 692 which would be fine, but if I try to access the item 50 it throws me [object HTMLOptionElement] What am I doing wrong?
Thx!