Compare Revisions

Element

Revision 438711:

Revision 438711 by teoli on

Revision 439177:

Revision 439177 by Techsin on

Title:
Element
Element
Slug:
Web/API/element
Web/API/element
Tags:
"DOM","DOM Reference"
"DOM","DOM Reference"
Content:

Revision 438711
Revision 439177
n71            {{ domxref("ElementTraversal.childElementCount") }}n71            {{ domxref("Element.childElementCount") }} {{ fx_minv
 >ersion_inline("3.5") }}
n93            {{ domxref("Element.children") }}n93            {{ domxref("Element.children") }} {{ gecko_minversion
 >_inline("1.9") }}
n182            {{ domxref("ElementTraversal.firstElementChild") }}n182            {{ domxref("ElementTraversal.firstElementChild") }} {
 >{ gecko_minversion_inline("1.9") }}
n226            {{ domxref("ElementTraversal.lastElementChild") }}n226            {{ domxref("ElementTraversal.lastElementChild") }} {{
 > gecko_minversion_inline("1.9") }}
nn249            {{ domxref("Element.name","name") }} /* not on Elemen
 >t, but on specific HTML*Element only */
250          </td>
251          <td>
252            Gets/sets the name attribute of an element.
253          </td>
254          <td>
255            <code><a href="/En/Core_JavaScript_1.5_Reference/Glob
 >al_Objects/String" title="en/Core_JavaScript_1.5_Reference/Global
 >_Objects/String">String</a></code>
256          </td>
257        </tr>
258        <tr>
259          <td>
n272            {{ domxref("ElementTraversal.nextElementSibling") }}n283            {{ domxref("ElementTraversal.nextElementSibling") }} 
 >{{ fx_minversion_inline("3.5") }}
n384            {{ domxref("ElementTraversal.previousElementSibling")n395            {{ domxref("ElementTraversal.previousElementSibling")
> }}> }} {{ fx_minversion_inline("3.5") }}
n466        {{ domxref("Element.onafterscriptexecute") }} {{ non-stann477        {{ domxref("Element.onafterscriptexecute") }} {{ gecko_mi
>dard_inline() }}>nversion_inline("2.0") }} {{ non-standard_inline() }}
n469        The event handling code for the {{event("afterscriptexecun480        The event handling code for the <code>afterscriptexecute<
>te")}} event; this is used only for {{ HTMLElement("script") }} e>/code> event; this is used only for {{ HTMLElement("script") }} e
>lements. Note that the event {{event("afterscriptexecute")}} is s>lements.
>tandard and part of HTML5. 
n472        {{ domxref("Element.onbeforescriptexecute") }} {{ non-stan483        {{ domxref("Element.onbeforescriptexecute") }} {{ gecko_m
>ndard_inline() }}>inversion_inline("2.0") }} {{ non-standard_inline() }}
n475        The event handling code for the {{event("beforescriptexecn486        The event handling code for the <code>beforescriptexecute
>ute")}} event; this is used only for {{ HTMLElement("script") }} ></code> event; this is used only for {{ HTMLElement("script") }} 
>elements. Note that the event {{event("beforescriptexecute")}} is>elements.
> standard and part of HTML5. 
n478        {{ domxref("Element.oncopy") }} {{ non-standard_inline() n489        {{ domxref("Element.oncopy") }} {{ Fx_minversion_inline("
>}}>3") }} {{ non-standard_inline() }}
n481        Returns the event handling code for the {{event("copy")}}n492        Returns the event handling code for the <code>copy</code>
> event.> event. (bug {{bug("280959")}})
n486        {{ domxref("Element.oncut") }} {{ non-standard_inline() }n497        {{ domxref("Element.oncut") }} {{ Fx_minversion_inline("3
>}>") }} {{ non-standard_inline() }}
n489        Returns the event handling code for the {{event("cut")}} n500        Returns the event handling code for the <code>cut</code> 
>event.>event. (bug {{bug("280959")}})
n494        {{ domxref("Element.onpaste") }} {{ non-standard_inline()n505        {{ domxref("Element.onpaste") }} {{ Fx_minversion_inline(
> }}>"3") }} {{ non-standard_inline() }}
n497        Returns the event handling code for the {{event("paste")}n508        Returns the event handling code for the <code>paste</code
>} event.>> event.(bug {{bug("280959")}})
n502        {{ domxref("element.onwheel","onwheel") }} {{ non-standarn513        {{ domxref("element.onwheel","onwheel") }} {{ gecko_minve
>d_inline() }}>rsion_inline("17.0") }} {{ non-standard_inline() }}
n787            {{ domxref("Element.querySelector") }}<code>( selecton798            {{ domxref("Element.querySelector") }}<code>( selecto
>rs )</code>>rs[, nsresolver] )</code> {{ fx_minversion_inline("3.5") }}
n795            {{ domxref("Element.querySelectorAll") }}<code>( selen806            {{ domxref("Element.querySelectorAll") }}<code>( sele
>ctors )</code>>ctors[, nsresolver] )</code>{{ fx_minversion_inline("3.5") }}
nn814            <p>
815              <strong>Element.remove();</strong>
816            </p>
817            <p>
818              Remove the element.<br>
803            {{ domxref("Element.removeAttribute") }}<code>( <a hr819              {{ domxref("Element.removeAttribute") }}<code>( <a 
>ef="/En/Core_JavaScript_1.5_Reference/Global_Objects/String" titl>href="/En/Core_JavaScript_1.5_Reference/Global_Objects/String" ti
>e="en/Core_JavaScript_1.5_Reference/Global_Objects/String">name</>tle="en/Core_JavaScript_1.5_Reference/Global_Objects/String">name
>a> )</code><br>></a> )</code><br>
804            Remove the named attribute from the current node.820              Remove the named attribute from the current node.
821            </p>
n1034            Added inheritance from the {{domxref("ElementTraversan1051            Added inheritance of the {{domxref("ElementTraversal"
>l")}} interface.>)}} interface.
n1085    <h2 id="Browser_compatibility">n
1086      Browser compatibility
1087    </h2>
n1089      {{CompatibilityTable}}n1103      &nbsp;
t1091    <div id="compat-desktop">t
1092      <table class="compat-table">
1093        <tbody>
1094          <tr>
1095            <th>
1096              Feature
1097            </th>
1098            <th>
1099              Chrome
1100            </th>
1101            <th>
1102              Firefox (Gecko)
1103            </th>
1104            <th>
1105              Internet Explorer
1106            </th>
1107            <th>
1108              Opera
1109            </th>
1110            <th>
1111              Safari (WebKit)
1112            </th>
1113          </tr>
1114          <tr>
1115            <td>
1116              Basic support
1117            </td>
1118            <td>
1119              {{CompatVersionUnknown}}
1120            </td>
1121            <td>
1122              {{CompatVersionUnknown}}
1123            </td>
1124            <td>
1125              {{CompatVersionUnknown}}
1126            </td>
1127            <td>
1128              {{CompatVersionUnknown}}
1129            </td>
1130            <td>
1131              {{CompatVersionUnknown}}
1132            </td>
1133          </tr>
1134          <tr>
1135            <td>
1136              Support for {{domxref("ElementTraversal")}}
1137            </td>
1138            <td>
1139              {{CompatVersionUnknown}}
1140            </td>
1141            <td>
1142              {{CompatGeckoDesktop("1.9")}} [*]
1143            </td>
1144            <td>
1145              9.0
1146            </td>
1147            <td>
1148              {{CompatVersionUnknown}}
1149            </td>
1150            <td>
1151              {{CompatVersionUnknown}}
1152            </td>
1153          </tr>
1154          <tr>
1155            <td>
1156              <code>children</code>
1157            </td>
1158            <td>
1159              {{CompatVersionUnknown}}
1160            </td>
1161            <td>
1162              {{CompatGeckoDesktop("1.9")}}
1163            </td>
1164            <td>
1165              {{CompatVersionUnknown}} [**]
1166            </td>
1167            <td>
1168              {{CompatVersionUnknown}}
1169            </td>
1170            <td>
1171              {{CompatVersionUnknown}}
1172            </td>
1173          </tr>
1174          <tr>
1175            <td>
1176              <code>querySelector()</code> and <code>querySelecto
>rAll()</code> 
1177            </td>
1178            <td>
1179              {{CompatUnknown}}
1180            </td>
1181            <td>
1182              {{CompatGeckoDesktop("1.9.1")}}
1183            </td>
1184            <td>
1185              {{CompatVersionUnknown}}
1186            </td>
1187            <td>
1188              {{CompatUnknown}}
1189            </td>
1190            <td>
1191              {{CompatUnknown}}
1192            </td>
1193          </tr>
1194          <tr>
1195            <td>
1196              <code>oncut</code>, <code>oncopy</code> and <code>o
>npaste</code> {{non-standard_inline}} 
1197            </td>
1198            <td>
1199              {{CompatNo}}
1200            </td>
1201            <td>
1202              {{CompatGeckoDesktop("1.9")}} ({{bug("280959")}})
1203            </td>
1204            <td>
1205              {{CompatUnknown}}
1206            </td>
1207            <td>
1208              {{CompatNo}}
1209            </td>
1210            <td>
1211              {{CompatNo}}
1212            </td>
1213          </tr>
1214          <tr>
1215            <td>
1216              <code>onafterscriptexecute</code> and <code>onbefor
>escriptexecute</code> {{non-standard_inline}} 
1217            </td>
1218            <td>
1219              {{CompatUnknown}}
1220            </td>
1221            <td>
1222              {{CompatGeckoDesktop("2.0")}}
1223            </td>
1224            <td>
1225              {{CompatUnknown}}
1226            </td>
1227            <td>
1228              {{CompatUnknown}}
1229            </td>
1230            <td>
1231              {{CompatUnknown}}
1232            </td>
1233          </tr>
1234          <tr>
1235            <td>
1236              <code>onwheel</code> {{non-standard_inline}}
1237            </td>
1238            <td>
1239              {{CompatNo}}
1240            </td>
1241            <td>
1242              {{CompatGeckoDesktop("17.0")}}
1243            </td>
1244            <td>
1245              {{CompatNo}}
1246            </td>
1247            <td>
1248              {{CompatNo}}
1249            </td>
1250            <td>
1251              {{CompatNo}}
1252            </td>
1253          </tr>
1254        </tbody>
1255      </table>
1256    </div>
1257    <div id="compat-mobile">
1258      <table class="compat-table">
1259        <tbody>
1260          <tr>
1261            <th>
1262              Feature
1263            </th>
1264            <th>
1265              Android
1266            </th>
1267            <th>
1268              Firefox Mobile (Gecko)
1269            </th>
1270            <th>
1271              IE Phone
1272            </th>
1273            <th>
1274              Opera Mobile
1275            </th>
1276            <th>
1277              Safari Mobile
1278            </th>
1279          </tr>
1280          <tr>
1281            <td>
1282              Basic support
1283            </td>
1284            <td>
1285              {{CompatVersionUnknown}}
1286            </td>
1287            <td>
1288              {{CompatVersionUnknown}}
1289            </td>
1290            <td>
1291              {{CompatVersionUnknown}}
1292            </td>
1293            <td>
1294              {{CompatVersionUnknown}}
1295            </td>
1296            <td>
1297              {{CompatVersionUnknown}}
1298            </td>
1299          </tr>
1300          <tr>
1301            <td>
1302              Support for {{domxref("ElementTraversal")}}
1303            </td>
1304            <td>
1305              {{CompatVersionUnknown}}
1306            </td>
1307            <td>
1308              {{CompatGeckoMobile("1.9")}} [*]
1309            </td>
1310            <td>
1311              {{CompatVersionUnknown}}
1312            </td>
1313            <td>
1314              {{CompatVersionUnknown}}
1315            </td>
1316            <td>
1317              {{CompatVersionUnknown}}
1318            </td>
1319          </tr>
1320          <tr>
1321            <td>
1322              <code>children</code>
1323            </td>
1324            <td>
1325              {{CompatVersionUnknown}}
1326            </td>
1327            <td>
1328              {{CompatGeckoMobile("1.9")}}
1329            </td>
1330            <td>
1331              {{CompatVersionUnknown}} [**]
1332            </td>
1333            <td>
1334              {{CompatVersionUnknown}}
1335            </td>
1336            <td>
1337              {{CompatVersionUnknown}}
1338            </td>
1339          </tr>
1340          <tr>
1341            <td>
1342              <code>querySelector()</code> and <code>querySelecto
>rAll()</code> 
1343            </td>
1344            <td>
1345              {{CompatUnknown}}
1346            </td>
1347            <td>
1348              {{CompatGeckoMobile("1.9.1")}}
1349            </td>
1350            <td>
1351              {{CompatVersionUnknown}}
1352            </td>
1353            <td>
1354              {{CompatUnknown}}
1355            </td>
1356            <td>
1357              {{CompatUnknown}}
1358            </td>
1359          </tr>
1360          <tr>
1361            <td>
1362              <code>oncut</code>, <code>oncopy</code> and <code>o
>npaste</code> {{non-standard_inline}} 
1363            </td>
1364            <td>
1365              {{CompatNo}}
1366            </td>
1367            <td>
1368              {{CompatGeckoMobile("1.9")}} ({{bug("280959")}})
1369            </td>
1370            <td>
1371              {{CompatUnknown}}
1372            </td>
1373            <td>
1374              {{CompatNo}}
1375            </td>
1376            <td>
1377              {{CompatNo}}
1378            </td>
1379          </tr>
1380          <tr>
1381            <td>
1382              <code>onafterscriptexecute</code> and <code>onbefor
>escriptexecute</code> {{non-standard_inline}} 
1383            </td>
1384            <td>
1385              {{CompatUnknown}}
1386            </td>
1387            <td>
1388              {{CompatGeckoMobile("2.0")}}
1389            </td>
1390            <td>
1391              {{CompatUnknown}}
1392            </td>
1393            <td>
1394              {{CompatUnknown}}
1395            </td>
1396            <td>
1397              {{CompatUnknown}}
1398            </td>
1399          </tr>
1400          <tr>
1401            <td>
1402              <code>onwheel</code> {{non-standard_inline}}
1403            </td>
1404            <td>
1405              {{CompatNo}}
1406            </td>
1407            <td>
1408              {{CompatGeckoMobile("17.0")}}
1409            </td>
1410            <td>
1411              {{CompatNo}}
1412            </td>
1413            <td>
1414              {{CompatNo}}
1415            </td>
1416            <td>
1417              {{CompatNo}}
1418            </td>
1419          </tr>
1420        </tbody>
1421      </table>
1422    </div>
1423    <p>
1424      [*] Gecko doesn't implement {{domxref("ElementTraversal")}}
> per se, but directly added all the methods and properties to the 
> {{domxref("Element")}} objects. 
1425    </p>
1426    <p>
1427      [**] Up to Internet Explorer 8 included, <code>children</co
>de> incorrectly listed comments. 
1428    </p>
1429    <h2 id="See_also">
1430      See also
1431    </h2>
1432    <ul>
1433      <li>All HTML elements inherits, via {{domxref("HTMLElement"
>)}} from this interface. 
1434      </li>
1435    </ul>

Back to History