0

How can i decode html entities with jquery like with php function htmlspecialchars_decode? I have this code:

                if (jQuery.trim(jQuery("#push_alert").val()) != "") {
                alert = jQuery("#push_alert").val();
            }

And whenever the text has & in it, it outputs %amp; Is there a simple way to do it?

anon123346
  • 13
  • 4

1 Answers1

0

As far i know jQuery itself will give you whatever you entered as a string.

<textarea id="mytextarea"> a & b</textarea>
        $('#mytextarea').keyup(function() {
             alert($(this).val())
         });

You can provide exact html and jQuery code to investigate further. Here is jsfiddle :https://jsfiddle.net/0ynm4zf1/