I have this php code snippet and i want to pass string in onclick function. if i just add php variable it will print the string as 3rd argument but sending me error undefined "String Value".
$mydata_rankings .= "[ \"$captainId\" ,\"$captain_name\", \"$phone\"
,\"$email\", \"$points\", \"$rank\", \"<a href='#'
onclick='updaterank($captainId,$points,$rank)'>Approve</a>\"], ";
The 3rd argument $rank is string first 2 are numbers so no problem.
HTML output:
<a href="#" onclick="updaterank(112,120,Gold)"> Approve </a>