Is it possible to get a child dom element, which will be the first child of a specific type.
For example in both of these examples I want to get the img ele
img
Here is a javascript function
function getFirst(con,tag) { return con.getElementsByTagName(tag)[0]; } //html markup //test var con=document.getElementById('mylink'); var first=getFirst(con,'img');