Try using :checked instead of [checked]
$("[id^='item-']:checked")

--
Hector


On Mon, Jul 20, 2009 at 9:09 AM, SvenV <sven.vanoirb...@gmail.com> wrote:

>
> I don't get it
> In my page I have several checkboxes like this one:
> <input id="item-8" type="checkbox"/>
>
> This is my Jquery code:
>
> function ShowSelected()
> {
>        var ids;
>        $("[id^='item-'][checked]").each(function(){ids = ids +"," +$
> (this).attr("id").split('-')[1];});
>        alert(ids);
> }
>
> This should give me a list of ids,right?
> I get nothing, an empty alert
>
> can anyone help?
> Thanks
>

Reply via email to