I have this code:
function discuss(thema){
$('#prep').val(thema + '<div>answer button</div>');
}
HTML:
<div id="quatschen">
<div id="prep"> </div>
</div>
it is not setting the value of prep, nothing happens if i click discuss() function.
discuss is called here:
<input type="text" name="thema" id="thema" />
<a href="javascript:discuss($('#thema').val())"> discuss me </a>
if I change val() to append(), it is working. why is val not working here?
Thanks for help
Use
.html()...valis only for input fields.