Javascript: get *updated* value of textarea
I have atext area on my page.I am filling it up from some data at page
load.Then user changes the data in textarea and I alert the text of
textarea.but I am getting the same value in alert which was initially
loaded in text area.It's not updating at all.
html:
<textarea rows="8" style="width: 60%" id="cmds"></textarea>
<input type="button" class="btn" value="alert" onclick="alertCmds()" />
javascript"
$.post('/AutoRegress/AutoRegress?cmd=cmdlist'{url:$('#url').val(),revId:$('#revId').val()},
function(data) {
$("#cmds").val(data.replace(/,/g,"\n"));
});
fuction alertCmds(){
alert($('#cmds').text());
}
No comments:
Post a Comment