JavaScript Reference/Javascript Methods/normalize

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"normalize()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function1() {

   document.all.myP.normalize();
   alert("The second paragraph has been normalized"); 

} </script>

First paragraph.

Second paragraph.

<input id="myB"

      type="button" 
      value="Normalize second paragraph" 
      onclick="function1();">

</body> </html>


     </source>
   
  


"normalize()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <applet> | | |<area> | | |<base> <basefont> | | | <bgsound> |

| |
|

| |<body>
| | |<button> |

| |
|

| | <col> | | |<colgroup> <comment> | | |<custom>

| | | |

| |<dir>
| | |
| | | <embed> | | |<fieldset> | | |<form> <frame> | | |<frameset> <head> | | |<hn>
|

| |<html> | | |<iframe> <img> | | |<input type="button"> <input type="checkbox"> | | |<input type="file"> <input type="hidden"> | | |<input type="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<input type="submit"> <input type="text"> | | | <isindex> | | | <label> |

| |<legend>
  • | | |<link> <listing> | | |<map> <marquee> | | |<menu> <meta> | | |<nobr> <noframes> | | |<noscript> <object> | | |
      <optgroup> | | |<option>

      | | |<param> <plaintext> | | |

                                                            |
      |                |                                                    |
      |                |                                                     |
      |                |<script>                        <select>                      |
      |                |                                                 |
      |                |                                              |
      |                |style                                                    |
      |                |                                                  |
      |                |<tbody>                                                   |
      |                |                                                       |
      |                |
        | | | <xml> | | |<xmp> | +----------------+--------------------------------------------------------------+ </source>

        "normalize()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Merges two adjacent text nodes into a single text node.

        Syntax:

        In the syntax below, elementID refers to either of two adjacent text nodes. document.getElementById("elementID").normalize() document.all.elementID.normalize() // IE only


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |<title>