Osmany González Osmany González - 2 months ago 7x
Javascript Question

OnClick on button with title

I need when click in a button with title = "Like" redirect to other page in javascript.

<button class="button-like button button-medium button-responsive" aria-describedby="tooltip-94" tabindex="0" title="Like">Like</button>


Make use of $('button[title="Like"]') selector and call onclick on it.


  $('button[title="Like"]').on('click', function(){
    window.location.href = 'https://www.google.com'