2

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>

2 Answers 2

0

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

$(function(){

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

Call a javascript function onclick of button and inside that javascript function use

window.location = "http://www.yoururl.com";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.