I am defining a element in html
<pre id="dict"></pre>
and I am setting the inner html like this
document.getElementById("dict").innerHTML=<p>ಒಂದ್</p>;
but the render is gibberish
ಒಂದà³
expected result
ಒಂದ್
what am i missing here?
I am defining a element in html
<pre id="dict"></pre>
and I am setting the inner html like this
document.getElementById("dict").innerHTML=<p>ಒಂದ್</p>;
but the render is gibberish
ಒಂದà³
expected result
ಒಂದ್
what am i missing here?
This worked for me, please try the below snippet.
$("#dict").html("<p>ಒಂದ್</p>")
var value = $("#dict").text();
alert(value)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<pre id="dict"></pre>