Cloud Stack Ninja

How to hide exactly the same span after clicking on the span with id + number?

<span id="myid-1"></span>
<span id="myid-2"></span>
<span id="myid-3"></span>

<script>
   $(document).click(function(){
    /**   if click button <span id="myid-1"> **/
       $('[id^="myid-"]').hide();
   })
</script>

Span is an old trash can icon that hides the entire post.



Read more here: https://stackoverflow.com/questions/64360688/jquery-parrend-id-for-hiden-selector-click-buttno-span

Content Attribution

This content was originally published by m kulas at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: