How to dynamically change the size of Text Area using javascript?
or
What are the events associated with form type textarea?
Event Handler | Description | Example |
onMouseOver | onMouseOver is invoked when a mouse is moved over the text area | <textarea name=textn onMouseOver="output()"> testing text area </textarea> Result : |
onMouseDown | onMouseDown is invoked when a mouse is pressed down inside the text area | <textarea name=textn onMouseDown="output()"> testing text area </textarea> Result : |
onMouseUp | onMouseUp is invoked when a mouse is pressed down inside the text area and released | <textarea name=textn onMouseUp="output()"> testing text area </textarea> Result : |
onClick | onClick is invoked when a mouse click is done inside the text area | <textarea name=textn onClick="output()"> testing text area </textarea> Result : |
onBlur | onBlur Executes some code when the text area loses focus using tab | <textarea name=textn onBlur="output()"> testing text area </textarea> Result : |
onFocus | onFocus Executes some code when the text area gets the focus using tab | <textarea name=textn onFocus="output()"> testing text area </textarea> Result : |
DOM Property | Description | Example |
defaultValue | Used to get and set the default value of the text area | To Get: var ss = document.form1.textn.defaultValue; |
form | Used to get the parent node (form object) of this Text area Node | To Get: var ss = document.form1.textn.form; |
name | Used to get TextArea name | To Get: var ss = document.form1.textn.name; |
type | Used to get form type | To Get: var ss = document.form1.textn.type; |
value | Used to set or get Text Area value | To Get: var ss = document.form1.textn.value; To Set:: document.form1.textn.value = "testy"; |
size | Used to set or get Text Area size | To Get: var ss = document.form1.textn.size; To Set:: document.form1.textn.size = 4; |
readOnly | Used to check or change readonly property. Users cannot enter any value if the text area is set as readonly. | To Check: var ss = document.form1.textn.readOnly; To Set:: document.form1.textn.readOnly = true; |
DOM Method | Description | Example |
select() | Used to dynamically select a text area | To Select: document.form1.textn.select(); |
blur() | Used to dynamically make the Text Area blur | To Blur: document.form1.textn.blur(); |
focus() | Used to dynamically get focus on the Text Area | To Focus: document.form1.textn.focus(); |