MykaMaxzou MykaMaxzou - 5 months ago 14
PHP Question

How to put html tags in <input value="xxx">

I'm working on a website for my internship and i'm facing some troubles.
I want to create a button with a special value. I'll link my code below so you'll be able to understand easier what i'm talking about :

<input type="button" class="newu" value="<i class='fa fa-pencil-square' aria-hidden='true'></i> <?php echo $nom_prod['nom_produit'] ; ?>"/>

The problem is that quotes aren't working like i would like them to since i'm using xxx times simple and double quotes.
If you guys have any clue how i could manage to fix this it would be really nice to tell me how.

Thanks in advance & bybye.


You could try using a button element instead of an input.

<button class="newu"> <i class='fa fa-pencil-square' aria-hidden='true'></i> <?php echo $nom_prod['nom_produit'] ;?> </button>

Good luck with your internship and happy coding!