I want to pass the php variable value in onClick function.
When i pass the php variable, in the UI i am getting the variable itself instead I need the value in the variable.
Below is code snippet, please help me.
<?php
print '<td>';
$node = $name->item(0)->nodeValue;
$insert= "cubicle"."$node<br>";
Echo '<a href= "#" onClick= showDetails("$node");>'. $insert .'</a> ';
print '</td>';
?>
Variable parsing is only done in double quoted strings. You can use string concatenation or, what I find more readable,
printf[docs]:The best way would be to not
echoHTML at all, but to embed PHP in HTML:You have to think less about quotes and debugging your HTML is easier too.
Note: If
$nodeis representing a number, you don’t need quotations marks around the argument.