I\'m not entirely sure if this is possible, but I\'m trying to create a mini faux editor in a browser that runs javascript on the page. Here\'s what I\'ve been trying to do
Not sure if this will work in JavaScript but it works in other languages, try importing your script into the script that has the text area then when you want to do the action in the text area call the method in the imported script that has the code you want to execute