找到了办法。
<textarea id="myTextarea" style="width: 98%; margin: 0px; height: 53px;" name="data[feedback][1]" class="js-feedback" placeholder="Hier uw opmerkingen..." autocomplete="off">Periode 0: Hier uw tekst
</textarea>
<script type="text/javascript">
$(".js-feedback").click(function(){
var v = $(this).val();
if($.browser.msie){
var htmElement = document.getElementById('myTextarea');
htmElement.setSelectionRange( v.length, v.length );
}
else{
$(this).val(v + ((v == '') ? '' : "\n\n") + "Periode 1: ");
}
return false;
});
</script>
确保你声明
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
还