перебрать элементы строки
Вот такой ещё вопрос:
взяли все элементы с тегом tr:
var rw = document.getElementsByTagName('tr');
что-то туплю, как в rw перебрать последовательно все его элементы (может быть <th>, <td>)? |
atanov,
rw[index].children или rw[index].cells |
<html>
<head>
</head>
<body>
<table>
<tr><td>1<td>2
<tr><td>3<td>4
</table>
<script>
[].forEach.call(document.querySelectorAll('tr>*'), function(el){
alert(el.textContent);
});
</script>
</body>
</html>
|
Спасибо!
|
| Часовой пояс GMT +3, время: 04:55. |