I want to put the value in textarea using the jquery. I'm using the following code. It is not working.
<link rel="stylesheet" href="css/jquery.wysiwyg.css" type="text/css" />
<script type="text/javascript" src="js/jquery.wysiwyg.js"></script>
<script type="text/javascript">
function wedit(topic){
$("#wysiwyg").html(topic);
alert(id+topic+instructor+date+video);
}
</script>
<form name="theform" action="" method="post">
<table border="0" cellpadding="10" cellspacing="10" width="680px">
<tr><td width="150">Topic:</td><td><span id="wtopic">
<textarea name="wysiwyg" id="wysiwyg" ></textarea></span></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="Save"
title="Save" /></td> </tr>
</table>
</form>
It is working in case of text but in case of textarea it is showing empty value. please let me know how can I put the text into the textarea through jquery or javascript??
Though when creating a textarea putting stuff between the
<textarea>and</textarea>tags results in it appearing in the textarea, when reading and writing from/to it in JavaScript, you need to use the.value="content"attribute, or in the case of jQuery,.val("content"). I see$("#wysiwyg").html(topic);, but that should probably be: