how to display data inside the alert box

I tried to enter a simple text word it appears then suddenly when I put the php inside the alert box it didn't show the data.

<script>

$(document).ready(function(){

$(“button”).click(function(){

alert(“($result[‘rightAns’] == ‘1’)”);

});

});

</script>

how can i display answer after i click the button