Auto Resizing Textarea HTML5 WebComponent

HTML5, CSS3 and JavaScript

The Fine Art of Web Development by Martin Ivanov

Just finished my next experiment with HTML5 WebComponents. AcidJs.XTextarea is an advanced replacement of the classic <textarea /> HTML element, supporting custom events and auto resizing as-you-type. Check the extensive documentation in the distribution file (click the download button at the top of the demo page) or scroll this page to see the demos.

thumb

Usage

[sourcecode language=”xml”]<acdisj-xtextarea></acdisj-xtextarea>
<acdisj-xtextarea placeholder="Type your message…" id="textarea-1" name="textarea-1" rows="5" cols="40"></acdisj-xtextarea>
<acdisj-xtextarea name="textarea-2" rows="10" cols="30" disabled></acdisj-xtextarea>
<acdisj-xtextarea name="textarea-5" autoresize="off" rows="5" cols="30"></acdisj-xtextarea>
<acdisj-xtextarea autofocus name="textarea-8" cols="60" rows="5"></acdisj-xtextarea>
<acdisj-xtextarea name="textarea-4" hidden></acdisj-xtextarea>[/sourcecode]

HTML Attributes of the Component

Apart from the form attributes like name, rows, cols, placeholder, spellcheck, autofocus, disabled and readonly etc. and the HTML standard attributes such is id and styleAcidJs.XTextarea supports one custom property, allowing to turn the autoresizing off:

JavaScript API – Methods, Accessors and Events

The component supports all standard JavaScript methods querySelector, querySelectorAll, getElementById, etc. plus the following custom methods, accessors and events:

Methods

Accessors

Events

If you share the same interest towards HTML5 Web Components as I do these days, make sure you read my relevant blog posts and further endeavors on my HTML5, CSS3 and JavaScript Experiments and Insight website.

Categories and Tags
Links

© 2006 - 2024 Martin Ivanov