Skip to content
Advertisement

Tag: textarea

How to add a keyboard listener to my onClick handler?

I have the following: My CSS: I need this because I need the textarea’s placeholder are to be horizontally and vertically centered in the page. Given textareas can’t vertically center text, I need to keep the height of the textarea short. I therefore need to make it so when the user clicks outside of the textarea, thinking they are clicking

Reacting to selection changes in an HTML textarea

How can I get, for an HTML textarea element, called back on all selection changes to the text edited therein? (I am currently using the hack of combining keyup, keypress, and mousemove (for dragging selection endpoint), and maybe more could be added, but this is not exactly elegant.) I can’t find it in HTML documentation or on Stack Overflow. By ‘all

execute javascript from textarea

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 in theory HTML javascript more specifically I’m trying to write to a canvas element via the ‘code’ I type into the text area, so that if, for

Max characters in textarea with jquery

I have the following code, and I’m kind of stuck on what to do next. The idea is when you enter text into a text area a counter tells you how many characters you have left. Once you get to the max characters I want to stop allowing characters to be entered, or delete all the characters that were entered

Creating a textarea with auto-resize

There was another thread about this, which I’ve tried. But there is one problem: the textarea doesn’t shrink if you delete the content. I can’t find any way to shrink it to the correct size – the clientHeight value comes back as the full size of the textarea, not its contents. The code from that page is below: Answer This

Advertisement