jQuery - Whatsapp button with id

0 votes
179 views
added Oct 22, 2020 in jQuery by lcjr First Warrant Officer (11,830 points)
<button type="button" id="wadonedeal" class="btn secondary-grey whatsapp-button"><img src="/assets/icons/whatsapp-original-60.png" width="30" height="30" alt="whatsapp">WhatsApp</button>

 

JS

$('#wadonedeal, #wadonedeal2').click(function(){
	var whatsAppPhone = '<?php echo $agentDet['contact']; ?>';
	var defaultMessage = "Hi, I'm interested!";
	window.open(
	"https://wa.me/"+'+60'+whatsAppPhone+"?text="+defaultMessage+" "+window.location.href,
	'_blank',
	);
});

 

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