Reputation: 4814
i am able to append the image and i want to append student id in hallticket number how can i do that.? This my html:
<td><b>Hallticket:</b>S<div><p class="hallticketNumber">***studentid has to come here***</p>J'+jobID+'</div></td>
<td><div><img class="participantphoto" src=""/><input class="searchStudent" type="text" autocomplete="off"><input class="studentId" type="hidden" name="gdtest['+studentCount+'][studentId]"></div></td>
this what i have tried:
$(this).closest('div').find(".studentId").attr("value",ui.item.student_pid);//working
$(this).closest('div').find(".participantphoto").attr("src",ui.item.profile_pic);//working
$(this).closest('div').find(".hallticketNumber").attr("label",ui.item.student_pid); //Notworking
the error is in last line near
.attr("label",ui.item.student_pid);
Upvotes: 3
Views: 47
Reputation: 28751
Use text() to change content of paragraph dynamically.
$(".hallticketNumber").text(ui.item.student_pid);
Upvotes: 2