JavaScript Reference/Javascript Properties/align 4

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

"align" Example

   <source lang="javascript">
   

<html> <head> <script>

   function function1() {
       document.all.myTable.align = event.srcElement.id; 
   } 

</script> </head> <body style="width:650;">

Cell 1 Cell 2
Cell 3 Cell 4


<input type="Button" id="center" value="align "center"" onClick="function1();"> <input type="Button" id="left" value="align "left"" onClick="function1();"> <input type="Button" id="right" value="align "right"" onClick="function1();"> </body></html>


     </source>
   
  


"align" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+

| Applied_To |<iframe> | +----------------+--------------------------------------------------------------+ </source>

"align" Possible Values

   <source lang="javascript">

Possible Values left, center (the default), right.


     </source>
   
  


"align" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Sets the element horizontal alignment, rather than its contents.

Syntax:

document.getElementById("elementID").align = value document.all.elementID.align = value // IE only


</source>