If I understand correctly, given the list you've shown, you want an
alert of the value of the <li> you just clicked, yes? If so:

$(function(){
   $('#developerul > li').click(function(){
      var value = $(this).attr('value');
      alert(value); // Or do whatever you wanted to do with javascript
here, using the value
   });
});

As for appendations:

I'm not sure which value is static (I assume that would be the
'thelistItems' part. If so:

$('#thelistItems_' + someOtherValue).append(txt);

On Jan 26, 10:59 am, Manowar721 <manowar...@gmail.com> wrote:
> As long as, I am understanding what you are trying to do...this should
> work.
>
>         $(document).ready(function(){
>
>         var values = new Array();
>         $("ul#developerul > li").addClass("getValues");
>         for (x=0;x<=3;x++){
>         values[x] = $("ul#developerul > li").eq(x).attr("value");
>         }
>         $("ul#developerul").click(function(){
>         alert (values);
>         });
>
>         });
>
> Outputs 1,2,3.
>
> Hope that helps,
> Manowar721
>
> On Jan 22, 3:38 pm, nk <neetuk...@gmail.com> wrote:
>
> > Hi All,
>
> > I have a list which is being populated dynamically from the database.I
> > am trying to capture the value of the list items (using click
> > function) and pass it to a query to get the result set.The value
> > attribute has been deprecated for LI.Please tell me a way to capture
> > the LI value.
>
> > <ul id="developerul">
> >  <li value='1'>One</li>
> > <li value='2'>Two</li>
> > <li value='3'>three</li>
> > </ul>
> >  For the above I have tried
> > $("#developerul".children())
> > and also $(this).children()
> > But does not work.
>
> > -------------------------------------
> > And also how can we concatenate a ID value
> > ID="thelistItems"
> > the result should be "thelistItems_11130".
>
> > $("#thelistItems+ _ + 11130").append(txt);
>
> > Thanks

Reply via email to