Autosize uses HTML attributes to initialize the autosize function. Here are the references for each below
HTML Attribute references
Name
Type
Description
data-kt-autosize
mandatory
Enables the current element as the Autosize component. Accepts true or false values.
Methods
All Autosize components can be initialized automatically through HTML attributes. However, it can also be programmatically intialized by ignoring the HTML attribute and manually initializing it via Javascript.
Name
Description
Static Methods
Initialization
Initializes Autosize instances by selecting the element required. This method can be used to initialize dynamicly populated Autosize instances(e.g: after Ajax request).
Triggers the height adjustment for an assigned textarea element. Autosize will automatically adjust the textarea height on keyboard and window resize events. There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element.
// Change value
autosize_element.vlaue = "some value";
autosize.update(autosize_element);
destroy
Removes Autosize and reverts any changes it made to the textarea element.