JavaScript Reference/Javascript Properties/cols 3

Материал из Web эксперт
Перейти к: навигация, поиск

"cols" Example

   <source lang="javascript">
   

<html> <body> <textarea id="myText" rows="3" cols="15" onclick="ab();"> </textarea>
<button onclick="myText.cols=100;">Set width of Textarea to 100</button> <button onclick="myText.rows=20;">Set height of Textarea to 20</button> </body> </html>


     </source>
   
  


"cols" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<textarea> | +----------------+--------------------------------------------------------------+

     </source>
   
  


"cols" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Sets the character width for <textarea>.

Syntax:

document.getElementById("textareaID").cols = value document.all.textareaID.cols = value // IE only


     </source>