How to select the containing li with jQuery -


 <li><span class="close">&times;</span> <%= item %></li> 

when user clicks close icon, want hide <li>. how can that?

not sure how "select" span, lets assume click.

$('.close').on('click', function() {     $(this).closest('li').hide(); }); 

you'd closest li element closest();


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -