Frontend Development

How can i JS click on copy li tags text elements with each?

Submitted by theabuzer, , Thread ID: 94355

Thread Closed

RE: How can i JS click on copy li tags text elements with each?

#2
Err not too sure what you want, but here's my suggestion. Install some jQuery and then read this: https://api.jquery.com/click/

Remember, if its a link use a, if its a javascript action then use button. Therefore, you want to do something like this


Code:
<ul id="my_list">
<li><button>1. yaz</button></li>
<li>Etc</li>

</ul>

<script>

$( "#my_list > li > button" ).click(function() {

      $_this = $(this);

     //do something.... like...
     $_this.addClass("hot-pink");


});

</script>

Users browsing this thread: 1 Guest(s)