I am using following segment of code to add onclick to anchor tag but apparently it is not working.
var address_edit = $('.edit-user a').attr('href'));
$('.edit-user a').prop('onclick', 'Popup("address_edit","Edit","900","500");')
What I want:
This is my code on inspect element:
<div class="edit-user">
<a href="example.com/nokidding">No kidding</a>
</div>
This is what I need it to be:
<div class="edit-user">
<a onclick='Popup("address_edit","Edit","900","500");' href="example.com/nokidding">No kidding</a>
</div>
onclickattribute to<a>using javascript. But the answers are not related to it. Can someone help me understand this please ?