i have some content stored inside a variable and i want to append that content String inside a html div.
This is the script code:
if ( $( "#eroare" ).val()!="") {
alert("Error 2" + $( "#eroare" ).val());
var aux = $( "#eroare" ).val();
alert("aux="+aux);
$( "#errorSuccess" ).html( "<b>" + aux + "</b>"); //this is not working
}
And this is the html:
<div id="errorSuccess" >ceva</div>
<div><input type="hidden" id="eroare" value="${sessionScope.errmsg}" /></div>
$("#errorSuccess").append("<b>" + aux + "</b>");
or, if you want to be at the beginning of the #errorSuccess
content, you need to replace append
with prepend
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With