This snipped is multiple times in my code, and i want to get user_id from the selected user
<li>
<div class="contact">
<div class="contact-name">James</div>
<p class="user_id">1234</p>
<div class="remove" onclick="remove()">Remove</div>
</div>
</li>
The code for jquery gets me an empty alert. I dont know what to change to get the user_id.
function remove() {
var id = $(this).parent().find('.user_id').text();
alert(id)
....
Does someone has an idea what i have to change?