HTML & CSS
Is it possible to have HTML in a button value to show as processed HTML? Like this the raw HTML tags are displayed on the button instead of 'two cubed'.
$value = "2<sup>3</sup>";
<input type = "button" name = "answerBTN" value="$value">
Use <button name="answerRTN">$value</button> instead.
Thank you, but that gives me the same result (perhaps it has something to do with me using prepared statements.) Besides I would rather keep the 'input' buttons since the whole site is adapted to them.
The button tag is for applying HTML styling to the button content - that's the only reason why it exists - because using input type="button" only allows plain text.
You also need to make sure that the value you are trying to use is not being processed through htmlspecialchars or htmlentities as that will convert the HTML tags in your content to text.
Using prepared statements should have no effect whatever.
I was converting the values to text. I removed that and have now also changed all buttons to the button tag. It works just fine.
Many thanks for your help!
This topic is now closed. New replies are no longer allowed.