Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

React - link via button with target (_blank, _self)

0 votes
13 views
added Apr 21 in React by lcjr Second Warrant Officer (5,360 points)
const agentfullContact = 'tel:4013011111';
<button
  type="button"
  onClick={e => {
    e.preventDefault();
    // window.location.href='http://google.com';
    window.open(agentfullContact, '_self');
  }}
>
  Call for price
</button>

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...