Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/11/2013, 11:31
Avatar de danny_
danny_
 
Fecha de Ingreso: septiembre-2012
Mensajes: 95
Antigüedad: 11 años, 7 meses
Puntos: 4
Respuesta: obtener id boton dinamico

Puedes obtener el id o cualquier atributo html con el método getAttribute(); Échale un ojo al ejemplo y enlace que te paso si es lo que necesitas.

Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.  
  3. Read about the <a href="dom_obj_attributes.asp" target="_blank">Attr object</a>.
  4.  
  5. <p id="demo">Click the button to display the value of the target attribute of the link above</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. function myFunction()
  10. {
  11. var a=document.getElementsByTagName("a")[0];
  12. document.getElementById("demo").innerHTML=a.getAttribute("target");
  13. }
  14.  
  15. </body>
  16. </html>



http://www.w3schools.com/jsref/met_e...tattribute.asp
__________________
http://www.danielcarvajal.es