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"?
It can be made with JavaScript with function replace():
function onTextareaInput() { document.getElementById("textarea").value = document.getElementById("textarea").value.replace("hc", "hollycrap"); }
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Testtt</title> </head> <body> <textarea id="textarea" oninput="onTextareaInput()"></textarea> </body> </html>
1.4m articles
1.4m replys
5 comments
57.0k users