Hi i want this code to be implemented…
var clone = $('<div><p>Email:'+email+'</p><div class="clear"></div>'+s+'<div class="clear"></div>Name: '+username+'</div>');
and my second string is this
<a href="javascript:;" id="usr_followbtn_3" onclick="user_follow('Tiger',this,'usr_unfollowbtn_3','You now follow Tiger.');" class="followusr" onfocus="this.blur();"><b>Follow</b></a>
and i want to be attach the second code to the first one something like this
var clone = $('<div><p>Email:'+email+'</p><div class="clear"></div>'+s+'<div class="clear"></div>Name: '+username+'<a href="javascript:;" id="usr_followbtn_2" onclick="user_follow(\'pranabksingh\\\'',this,'\usr_unfollowbtn_2\\\',\'You now follow pranabksingh\\\');" class="followusr" onfocus="this.blur();"><b>Follow</b></a></div>');
But it doesn’t work… i think there’s a problem with the single quotes…
You can append the link to the div element using this:
But I believe better solution is to attach link’s event listeners later or something link this:
http://jsfiddle.net/HNjtf/
And the string you want to construct should be something like that:
Actually I’m not advising you to do something like the upper snipped.