![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
30/06/2010, 04:46
|
| | Fecha de Ingreso: septiembre-2009
Mensajes: 215
Antigüedad: 15 años, 4 meses Puntos: 1 | |
Respuesta: Como buscar por nombre de objetos con javascript Algo así podría funcionar:
<html>
<body>
<table>
<tr id = "tabla">
<td id="1234-23" class="blanco">1</tr>
<td id="1235-27" class="blanco">2</tr>
<td id="1234-13" class="blanco">3</tr>
<td id="1234-78" class="blanco">4</tr>
<td id="1235-78" class="blanco">5</tr>
<td id="1244-23" class="blanco">6</tr>
</tr>
</table>
</body>
</html>
Codigo javascript:
function buscar23()
{
var tabla = document.getElementById("tabla")
if (tabla.hasChilds())
{
var hijoActual = tabla.firstChild;
while(hijoActual)
{
if(hijoActual.id.split("-")[1] == 23)
//guardas en el array el id
hijoActual = hijoActual.nextSibling();
}
}
} |