We add a Default Tweet Button API on my site. it's work perfect and load new window and send the tweet.
but i want to get the value of the tweet count id. or if anybody click on the tweet button and submit a tweet .
then my page show an alert message .
aler "Tweet send succefully."
Please help me how we can do this. Thanks
//Here is the API
<html>
<script type="text/javascript">
window.twttr=(function(d,s,id){
var t,js,fjs=d.getElementsByTagName(s)[0];
if(d.getElementById(id)){
return
}
js=d.createElement(s);
js.id=id;
js.src="https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
return window.twttr||(t={_e:[],ready:function(f){
t._e.push(f)
}})}
(document,"script","twitter-wjs"));
</script>
<script>
function myFunction() {
var x = document.getElementById('count');
document.getElementById("result").innerHTML = x;
aler ('tweet send succesfully. ';
}
</script>
<body>
<a onclick="myFunction()" class="twitter-share-button" href="https://twitter.com/share" target="_blank">
Tweet
</a>
<p id="result"></p>
</body>
</html>