aboutsummaryrefslogtreecommitdiff
path: root/files/pt-pt/dom/element/index.html
blob: 7b9a55f2609f3a6f2a3dbe94fd3753f09e44c34b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
---
title: element
slug: DOM/element
tags:
  - API
  - API da Web
  - DOM
  - Element
  - Elemento
  - Interface
  - Referencia
  - Referência DOM
translation_of: Web/API/Element
---
<div>{{APIRef("DOM")}}</div>

<p><span class="seoSummary"><strong><code>Element</code></strong> </span>é a classe base mais geral da qual todos os objetos em um <span class="seoSummary">{{DOMxRef("Document","documento")}} herdam. Este só tem métodos e propriedades comuns para todos os tipos de elementos. </span>Classes mais específicas herdam de<span class="seoSummary"> <code>Element</code>.</span> Por exemplo, a interface {{DOMxRef("HTMLElement")}} é a interface base para os elementos HTML, enquanto a interface {{DOMxRef("SVGElement")}} é a base para todos os elementos SVG. A maioria das funcionalidades é especificada mais abaixo na hierarquia de classes.</p>

<p>Linguagens fora do âmbito da plataforma Web, como XUL através da interface <code>XULElement</code>, também implementa <code>Element</code>.</p>

<p>{{InheritanceDiagram}}</p>

<h2 id="Propriedades" name="Propriedades">Propriedades</h2>

<p><em>Inherits properties from its parent interface, {{DOMxRef("Node")}}, and by extension that interface's parent, {{DOMxRef("EventTarget")}}. It implements the properties of {{DOMxRef("ParentNode")}}, {{DOMxRef("ChildNode")}}, {{DOMxRef("NonDocumentTypeChildNode")}}, </em>and {{DOMxRef("Animatable")}}.</p>

<table class="fullwidth-table">
 <tbody>
  <tr>
   <th>Nome</th>
   <th>Descrição</th>
   <th>Tipo</th>
   <th>Dosponibilidade</th>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.attributes">attibutes</a></code></td>
   <td>Todos os atributos associados ao elemento</td>
   <td><code><a href="pt/DOM/NamedNodeMap">NamedNodeMap</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.childNodes">childNodes</a></code></td>
   <td>Todos os nós-filhos de um elemento.</td>
   <td><code><a href="pt/DOM/NodeList">NodeList</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.className">className</a></code></td>
   <td>Retorna ou define a classe do elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.clientHeight">clientHeight</a></code></td>
   <td>A altura interna de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.clientLeft">clientLeft</a></code></td>
   <td>A largura da borda esquerda de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.clientTop">clientTop</a></code></td>
   <td>A largura da borda superior de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.clientWidth">clientWidth</a></code></td>
   <td>A largura interna de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.dir">dir</a></code></td>
   <td>Retorna ou define a direcionalidade do elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.firstChild">firstChild</a></code></td>
   <td>O primeiro nó-filho direto de um elemento, ou <code>null</code> se o elemento não tem nós-filhos.</td>
   <td><code><a href="pt/DOM/Node">Node</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.id">id</a></code></td>
   <td>Retorna ou define o id do elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.innerHTML">innerHTML</a></code></td>
   <td>Retorna ou define a marcação e o conteúdo de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.lang">lang</a></code></td>
   <td>Retorna ou define o atributo linguagem de um elemento, texto, e conteúdo do elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.lastChild">lastChild</a></code></td>
   <td>O último nó-filho direto de um elemento, ou <code>null</code> se o elemento não tem nós-filhos.</td>
   <td><code><a href="pt/DOM/Node">Node</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.localName">localName</a></code></td>
   <td>A parte local de um nome qualificado de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <th>Nome</th>
   <th>Descrição</th>
   <th>Tipo</th>
   <th>Disponibilidade</th>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.name">name</a></code></td>
   <td>Retorna/define o atributo name de um elemento.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.namespaceURI">namespaceURI</a></code></td>
   <td>A URI de namespace do nó, ou <code>null</code> se não está especificado.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.nextSibling">nextSibling</a></code></td>
   <td>O nó imediatamente seguinte ao dado numa árvore, ou <code>null</code> se não existe nó-irmão.</td>
   <td><code><a href="pt/DOM/Node">Node</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.nodeName">nodeName</a></code></td>
   <td>O nome do nó.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.nodeType">nodeType</a></code></td>
   <td>Um número representando o tipo do nó. É sempre igual a <code>1</code> para elementos DOM.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.nodeValue">nodeValue</a></code></td>
   <td>O valor do nó. É sempre igual a <code>null</code> para elementos DOM.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.offsetHeight">offsetHeight</a></code></td>
   <td>A altura de um elemento, em relação ao layout.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.offsetLeft">offsetLeft</a></code></td>
   <td>A distância da borda esquerda do elemento para o a borda esquerda do seu <code>offsetParent</code>.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.offsetParent">offsetParent</a></code></td>
   <td>O elemento para o qual todos cálculos de offset estão atualmente computados.</td>
   <td><code><a href="pt/DOM/element">Element</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.offsetTop">offsetTop</a></code></td>
   <td>A distância da borda superior do elemento para o a borda superior do seu <code>offsetParent</code>.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.offsetWidth">offsetWidth</a></code></td>
   <td>A largura de um elemento, em relação ao layout.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.ownerDocument">ownerDocument</a></code></td>
   <td>O documento no qual o nó está, ou <code>null</code> se o nó não está dentro de nenhum.</td>
   <td><code><a href="pt/DOM/document">Document</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <th>Nome</th>
   <th>Descrição</th>
   <th>Tipo</th>
   <th>Disponibilidade</th>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.parentNode">parentNode</a></code></td>
   <td>The parent element of this node, or <code>null</code> if the node is not inside of a <a href="pt/DOM/document">DOM Document</a>.</td>
   <td><code><a href="pt/DOM/Node">Node</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.prefix">prefix</a></code></td>
   <td>The namespace prefix of the node, or <code>null</code> if no prefix is specified.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.previousSibling">previousSibling</a></code></td>
   <td>The node immediately preceding the given one in the tree, or <code>null</code> if there is no sibling node.</td>
   <td><code><a href="pt/DOM/Node">Node</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.scrollHeight">scrollHeight</a></code></td>
   <td>The scroll view height of an element.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.scrollLeft">scrollLeft</a></code></td>
   <td>Gets/sets the left scroll offset of an element.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.scrollTop">scrollTop</a></code></td>
   <td>Gets/sets the top scroll offset of an element.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.scrollWidth">scrollWidth</a></code></td>
   <td>The scroll view width of an element.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.style">style</a></code></td>
   <td>An object representing the declarations of an element's style attributes.</td>
   <td><code><a href="pt/DOM/CSSStyleDeclaration">CSSStyle</a></code></td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.tabIndex">tabIndex</a></code></td>
   <td>Gets/sets the position of the element in the tabbing order.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Number">Number</a></code></td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.tagName">tagName</a></code></td>
   <td>The name of the tag for the given element.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.textContent">textContent</a></code></td>
   <td>Gets/sets the textual contents of an element and all its descendants.</td>
   <td><code><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></code></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
 </tbody>
</table>

<h3 id="Methods" name="Methods">Métodos</h3>

<table class="fullwidth-table">
 <tbody>
  <tr>
   <th>Nome &amp; Descrição</th>
   <th>Retorna</th>
   <th>Disponibilidade</th>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.addEventListener">addEventListener</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">type</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Function">listener</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">useCapture</a> )</code><br>
    Register an event handler to a specific event type on the element.</td>
   <td>-</td>
   <td><small><a href="pt/DOM/event">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.appendChild">appendChild</a>( <a href="pt/DOM/Node">appendedNode</a> )</code><br>
    Insert a node as the last child node of this element.</td>
   <td><a href="pt/DOM/Node">Node</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.blur">blur</a>()</code><br>
    Removes keyboard focus from the current element.</td>
   <td>-</td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.click">click</a>()</code><br>
    Simulates a click on the current element.</td>
   <td>-</td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.cloneNode">cloneNode</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">deep</a> )</code><br>
    Clone a node, and optionally, all of its contents.</td>
   <td><a href="pt/DOM/Node">Node</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.dispatchEvent">dispatchEvent</a>( <a href="pt/DOM/event">event</a> )</code><br>
    Dispatch an event to this node in the DOM.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">Boolean</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.focus">focus</a>()</code><br>
    Gives keyboard focus to the current element.</td>
   <td>-</td>
   <td><small><a href="pt/HTML">HTML</a>, <a href="pt/XUL">XUL</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.getAttribute">getAttribute</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Retrieve the value of the named attribute from the current node.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.getAttributeNS">getAttributeNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Retrieve the value of the attribute with the specified name and namespace, from the current node.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.getAttributeNode">getAttributeNode</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Retrieve the node representation of the named attribute from the current node.</td>
   <td><a href="pt/DOM/Attr">Attr</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.getAttributeNodeNS">getAttributeNodeNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Retrieve the node representation of the attribute with the specified name and namespace, from the current node.</td>
   <td><a href="pt/DOM/Attr">Attr</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <th>Nome &amp; Descrição</th>
   <th>Retorna</th>
   <th>Disponibilidade</th>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.getElementsByTagName">getElementsByTagName</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Retrieve a set of all descendant elements, of a particular tag name, from the current element.</td>
   <td><a href="pt/DOM/NodeSet">NodeSet</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Retrieve a set of all descendant elements, of a particular tag name and namespace, from the current element.</td>
   <td><a href="pt/DOM/NodeSet">NodeSet</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.hasAttribute">hasAttribute</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Check if the element has the specified attribute, or not.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">Boolean</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.hasAttributeNS">hasAttributeNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Check if the element has the specified attribute, in the specified namespace, or not.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">Boolean</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.hasAttributes">hasAttributes</a>()</code><br>
    Check if the element has any attributes, or not.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">Boolean</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.hasChildNodes">hasChildNodes</a>()</code><br>
    Check if the element has any child nodes, or not.</td>
   <td><a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">Boolean</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.insertBefore">insertBefore</a>( <a href="pt/DOM/Node">insertedNode</a>, <a href="pt/DOM/Node">adjacentNode</a> )</code><br>
    Inserts the first node before the second, child, Node in the DOM.</td>
   <td><a href="pt/DOM/Node">Node</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.normalize">normalize</a>()</code><br>
    Clean up all the text nodes under this element (merge adjacent, remove empty).</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.removeAttribute">removeAttribute</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Remove the named attribute from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.removeAttributeNS">removeAttributeNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Remove the attribute with the specified name and namespace, from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <th>Nome &amp; Descrição</th>
   <th>Retorna</th>
   <th>Disponibilidade</th>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.removeAttributeNode">removeAttributeNode</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a> )</code><br>
    Remove the node representation of the named attribute from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.removeChild">removeChild</a>( <a href="pt/DOM/Node">removedNode</a> )</code><br>
    Removes a child node from the current element.</td>
   <td><a href="pt/DOM/Node">Node</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.removeEventListener">removeEventListener</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">type</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Function">handler</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">useCapture</a> )</code><br>
    Removes an event listener from the element.</td>
   <td>-</td>
   <td><small><a href="pt/DOM/event">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.replaceChild">replaceChild</a>( <a href="pt/DOM/Node">insertedNode</a>, <a href="pt/DOM/Node">replacedNode</a> )</code><br>
    Replaces one child node in the current element with another.</td>
   <td><a href="pt/DOM/Node">Node</a></td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.scrollIntoView">scrollIntoView</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">alignWithTop</a> )</code><br>
    Scrolls the page until the element gets into the view.</td>
   <td>-</td>
   <td><small><a href="pt/HTML">HTML</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.setAttribute">setAttribute</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Object">value</a> )</code><br>
    Set the value of the named attribute from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.setAttributeNS">setAttributeNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/Object">value</a> )</code><br>
    Set the value of the attribute with the specified name and namespace, from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.setAttributeNode">setAttributeNode</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a>, <a href="pt/DOM/Attr">attrNode</a> )</code><br>
    Set the node representation of the named attribute from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
  <tr>
   <td><code><a href="pt/DOM/element.setAttributeNodeNS">setAttributeNodeNS</a>( <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">namespace</a>, <a href="pt/Core_JavaScript_1.5_Reference/Global_Objects/String">name</a>, <a href="pt/DOM/Attr">attrNode</a> )</code><br>
    Set the node representation of the attribute with the specified name and namespace, from the current node.</td>
   <td>-</td>
   <td><small><a href="pt/DOM">All</a></small></td>
  </tr>
 </tbody>
</table>

<h3 id="Event_Handlers" name="Event_Handlers">Event Handlers</h3>

<p>These are properties that correspond to the HTML 'on' event attributes.</p>

<p>Unlike the corresponding attributes, the values of these properties are functions (or any other object implementing the <a class="external" href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener">EventListener</a> interface) rather than a string. In fact, assigning an event attribute in HTML creates a wrapper function around the specified code. For example, given the following HTML:</p>

<pre>&lt;div onclick="foo();"&gt;click me!&lt;/div&gt;
</pre>

<p>If <code>element</code> is a reference to this <code>div</code>, the value of <code>element.onclick</code> is effectively:</p>

<pre>function onclick(event) {
   foo();
}
</pre>

<p>Note how the <a href="pt/DOM/event">event</a> object is passed as parameter <code>event</code> to this wrapper function.</p>

<dl>
 <dt><a href="pt/DOM/element.onblur">onblur</a></dt>
 <dd>Returns the event handling code for the blur event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onchange">onchange</a></dt>
 <dd>Returns the event handling code for the change event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onclick">onclick</a></dt>
 <dd>Returns the event handling code for the click event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.ondblclick">ondblclick</a></dt>
 <dd>Returns the event handling code for the dblclick event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onfocus">onfocus</a></dt>
 <dd>Returns the event handling code for the focus event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onkeydown">onkeydown</a></dt>
 <dd>Returns the event handling code for the keydown event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onkeypress">onkeypress</a></dt>
 <dd>Returns the event handling code for the keypress event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onkeyup">onkeyup</a></dt>
 <dd>Returns the event handling code for the keyup event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onmousedown">onmousedown</a></dt>
 <dd>Returns the event handling code for the mousedown event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onmousemove">onmousemove</a></dt>
 <dd>Returns the event handling code for the mousemove event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onmouseout">onmouseout</a></dt>
 <dd>Returns the event handling code for the mouseout event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onmouseover">onmouseover</a></dt>
 <dd>Returns the event handling code for the mouseover event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onmouseup">onmouseup</a></dt>
 <dd>Returns the event handling code for the mouseup event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onresize">onresize</a></dt>
 <dd>Returns the event handling code for the resize event.</dd>
</dl>

<dl>
 <dt><a href="pt/DOM/element.onscroll">onscroll</a></dt>
 <dd>Returns the event handling code for the scroll event.</dd>
</dl>

<div class="noinclude"> </div>

<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2>



<p>{{Compat("api.Element")}}</p>