我有一些内容存储在变量中,我想在html div中追加内容String.
这是脚本代码:
if ( $( "#eroare" ).val()!="") { alert("Error 2" + $( "#eroare" ).val()); var aux = $( "#eroare" ).val(); alert("aux="+aux); $( "#errorSuccess" ).html( "" + aux + ""); //this is not working }
这是html:
ceva
n1kkou.. 7
$("#errorSuccess").append("" + aux + "");
或者,如果您想要在#errorSuccess
内容的开头,则需要替换append
为prepend