I am putting a html inside the php echo like .
echo '<td onclick="getdesc($descriptn)">';
My problem is onclick is not working i also tried like
echo '<td onclick="getdesc(\'$descriptn\')">';
But in this i am not geting the value of variable $descriptn is directly printing .
Please tell me what is the right way to do this ,
Change to
echo '<td style="margin-top: 3px; padding: 3px 2px; background: none repeat scroll 0px 0px #E9E9E9;" onclick="getdesc(\''.$descriptn.'\')" >';
use double quote for this, that was the mistake.
echo "<td style='margin-top: 3px; padding: 3px 2px; background: none repeat scroll 0px 0px #E9E9E9;' onclick='getdesc(\'$descriptn\')' >";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With