Referring to an object's ID in a jQuery append statement
Posted
by Summer
on Stack Overflow
See other posts from Stack Overflow
or by Summer
Published on 2010-03-31T14:02:13Z
Indexed on
2010/03/31
14:03 UTC
Read the original article
Hit count: 292
jQuery
|JavaScript
I have this element:
<div class="isthisyou" id="unique_identifier"></div>
I want to use jQuery to insert a link into the div:
$('isthisyou').append('<a href="auth/create_account/'+this.id+'">Is this you?</a>');
Right now this.id
is returning undefined
instead of unique_identifier
. What am I doing wrong?
Thanks!
© Stack Overflow or respective owner