I have to show the contact num from database when user click on the button.. but when I use php in javaScript it doesn't work for me... here is HTML
<button name="showNo" id="phone1" onclick="myFunction()"><span>Show Phone No</span></button>
<p id="show">******</p>
here the JavaScript
<script type="text/javascript">
function myFunction(){
var hsh = document.getElementById("show");
if ( hsh.value === "******" )
hsh.value = "<?php echo $contact; ?>";
else
hsh.value = "Open Curtain";
}
</script>
is there any other method to do this,,?