how to get a php values contain spaces with javascript? I have a php code below
<?php
$firstName = "my first name";
echo "<input type='button' onclick=showFirstName(".$firstName.");>";
?>
and my script below
<script>
function showFirstName(firstName){
alert(firstName);
}
</script>
and that alert wont work, it is different if just like $firstName = "My".
anyone have solution?
Thankyou :)
...onclick=showFirstName('".$firstName."');>";