I'd like to pass a PHP variable to a JS function as in:
onclick='handleClick($phpVar);'
But unfortunately, the function doesn't take the value, even after converting the php variable into a string.
The two code blocks look like this:
PHP:
while($stmt->fetch()) {
echo "<tr><td>"
. htmlspecialchars($company)
. "</td><td id='$price'>"
. htmlspecialchars($volume)
. "</td><td id='$price'>"
. htmlspecialchars($price)
. "</td><td>"
<button type='submit' class='submit-btn'>Submit</button>
</td><td>
<label tabindex='0' class='checkbox'>
<input type='checkbox' style='opacity:0' checked='checked' onclick='handleClick($price);'/>
<i class='close-btn fa fa-edit'></i>
</label>
</td></tr>";
}
JavaScript:
function handleClick(id) {
document.getElementById(id).style.fontSize=="150%");
}