With the following code, textarea stops updating from 'plotclick' events after the text in textarea has been manually changed. If you only click in the textarea but don't change the value, textarea will continue to update. How can I make textarea continue to update on 'plotclick' events even if the value has been manually changed?
<div id="placeholder" style="width:500px; height:300px;"></div>
<textarea id="myNum"></textarea>
<script>
var d1 = [];
for (var i = 0; i < 14; i += 0.5) {
d1.push([i, Math.sin(i)]);
}
$(function() {
$("#placeholder").on("plotclick", function (event, pos, item) {
$("#myNum").text(pos.x);
});
$.plot("#placeholder", [d1], {grid: {clickable: true}});
});
</script>
jsfiddle: http://jsfiddle.net/grkblood13/PbLkx/2/