The error I get in firebug is

$(".msg").id is undefined

basically what I'm trying to do is pass this into an ajax post to delete the message, so it's vital the id is the same one from the database.

MorningZ wrote:
"but this doesn't work."

Care to elaborate?    do you get an error?  unexpected results?
something else?


On Nov 7, 7:19 am, Liam Potter <[EMAIL PROTECTED]> wrote:
Hi guys, this should be a quick one

I have a div, which has a unqiue id (pulled from the database) so
something like this.

<div class="msg" id="msg<%#Eval("PrimaryKeyID")%>">
</div>

and I'm trying to get the id number from it like this

var uid = $(".msg").id.replace('msg', "");

as I'm running a similar function

$("span.yes").click(function (event) {
            event.preventDefault();
            var inc = this.id.replace('yes', "");

});

I thought I could just replace the this for a selector but this doesn't
work.

Can anyone let me know how I would do this.

Thanks,
Liam

Reply via email to