You can solve this problem by checking if the link opens or not.
Here is my code
<a id="share_whatsapp" onclick="open_whatsapp()">Share with Whatsapp</a> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js?ver=4.1' type='text/javascript'></script> <script> function open_whatsapp(){ $.ajax({ type: 'HEAD', url: 'whatsapp://send?text=text=Hello%20World!', success: function() { window.location='whatsapp://send?text=text=Hello%20World!'; }, error: function() { alert("Whatspp not installed"); } }); } </script>
source share