I have a textarea and every time the user enters "enter", I would like to populate the current line with a value.
I want to nudge the user to start each line with a certain phrase, such as "I am".
HTML:
<textarea class="texty"></textarea>
CSS:
.texty {
width: 400px;
height: 300px;
}
jQuery:
$(document).ready(function() {
$(".texty").bind("keydown", function(e) {
if (e.which == 13) {
// User entered a newline.
// Start the line with the phrase "I am"
console.log("enterrrrr");
}
});
});
Thank you for the help.