I’m working in a project and can’t find the fix for this:
$("#description").attr("value", '<?php echo htmlentities($version["Description"], ENT_NOQUOTES);?>');
The value of $version["Description"] is Genérica and in the value of the input text isGen & eacute ; rica.
I tried:
header('Content-type: text/html; charset=UTF-8') ;
as well as different encodings on htmlentities like iso or utf-8.
I think that .html() of jquery can help but how do I use it on attr for value?
You are looking for jQuery val function to post something in an input (or textarea).
What you really want is to html_entity_decode (transfers
éin é) instead of htmlentities (é iné).