Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 Google Inc.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   * use this file except in compliance with the License. You may obtain a copy of
   * the License at
   * 
   * http://www.apache.org/licenses/LICENSE-2.0
   * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
  */
 package elemental.html;
 
 import  elemental.html.*;
 
 import java.util.Date;

DOM TextArea objects expose the HTMLTextAreaElement (or HTML 4 HTMLTextAreaElement) interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of <textarea> elements.
 
 public interface TextAreaElement extends Element {


  
Reflects the autofocus HTML attribute, indicating that the control should have input focus when the page loads
 
   boolean isAutofocus();
 
   void setAutofocus(boolean arg);


  
Reflects the cols HTML attribute, indicating the visible width of the text area.
 
   int getCols();
 
   void setCols(int arg);


  
The control's default value, which behaves like the textContent property.
 
 
   void setDefaultValue(String arg);
 
 
   void setDirName(String arg);


  
Reflects the disabled HTML attribute, indicating that the control is not available for interaction.
 
   boolean isDisabled();
 
   void setDisabled(boolean arg);


  

The containing form element, if this element is in a form. If this element is not contained in a form element:

  • HTML5 this can be the id attribute of any <form> element in the same document.
  • HTML 4 this must be null.
 
   FormElement getForm();


  
A list of <label> elements that are labels for this element.
 
   NodeList getLabels();


  
Reflects the maxlength HTML attribute, indicating the maximum number of characters the user can enter. This constraint is evaluated only when the value changes.
  int getMaxLength();
  void setMaxLength(int arg);


  
Reflects name HTML attribute, containing the name of the control.
  void setName(String arg);


  
Reflects the placeholder HTML attribute, containing a hint to the user about what to enter in the control.
  void setPlaceholder(String arg);


  
Reflects the readonly HTML attribute, indicating that the user cannot modify the value of the control.
  boolean isReadOnly();
  void setReadOnly(boolean arg);


  
Reflects the required HTML attribute, indicating that the user must specify a value before submitting the form.
  boolean isRequired();
  void setRequired(boolean arg);


  
Reflects the rows HTML attribute, indicating the number of visible text lines for the control.
  int getRows();
  void setRows(int arg);


  
The direction in which selection occurred. This is "forward" if selection was performed in the start-to-end direction of the current locale, or "backward" for the opposite direction. This can also be "none" if the direction is unknown."
  void setSelectionDirection(String arg);


  
The index of the end of selected text. HTML5 If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if setSelectionRange() had been called with this as the second argument, and selectionStart as the first argument.
  int getSelectionEnd();
  void setSelectionEnd(int arg);


  
The index of the beginning of selected text. HTML5 If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if setSelectionRange() had been called with this as the first argument, and selectionEnd as the second argument.
  void setSelectionStart(int arg);


  
The codepoint length of the control's value.
  int getTextLength();


  
The string textarea.
  String getType();


  
A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
The validity states that this element is in.
The raw value contained in the control.
  void setValue(String arg);


  
Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.
  boolean isWillValidate();


  
Reflects the wrap HTML attribute, indicating how the control wraps text.
  void setWrap(String arg);


  
Returns false if the button is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an invalid event at the control. It returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints.
  boolean checkValidity();


  
Selects the contents of the control.
  void select();


  
Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
  void setCustomValidity(String error);


  
Selects a range of text, and sets selectionStart and selectionEnd. If either argument is greater than the length of the value, it is treated as pointing to the end of the value. If end is less than start, then both are treated as the value of end.
  void setSelectionRange(int startint end);


  
Selects a range of text, and sets selectionStart and selectionEnd. If either argument is greater than the length of the value, it is treated as pointing to the end of the value. If end is less than start, then both are treated as the value of end.
  void setSelectionRange(int startint endString direction);
New to GrepCode? Check out our FAQ X