Solution 1 :

It can be made with JavaScript with function replace():

function onTextareaInput() {
 document.getElementById("textarea").value = document.getElementById("textarea").value.replace("hc", "hollycrap");
<!DOCTYPE html>
    <meta charset="utf-8" />
    <textarea id="textarea" oninput="onTextareaInput()"></textarea>

Problem :

I have a text area that I would like to be able to autocomplete pre-defined terms. So for example, if a user types “hc” it will autocomplete to “hollycrap”?


Comment posted by pawello2222

Please add tags specifying the language/frameworks/etc.

Comment posted by How to Ask