<li id = "position0">
Word
<div>
<ul>
<li>
word
<span class = "change_word_button">change</span>
</li>
<ul>
</div>
</li>
$('#words_block').on('click', '.change_word_button', function(event) { //position in text of word (saved in id of element) var position = +$(this).parent().parent().parent().parent().attr('id').substr(8) });