I have an html block, that contains a lot of children.
<div id="selectedId">
<div class=".."><a class=".."></a>
<button style=".."></button>
</div>
<div id="otherId">
<table></table>
</div>
</div>
I am using jquery to select the parent. I am then trying to loop over all the descendants and access various properties, such as class or innerHtml. I seem unable to access their properties.
function rewriteCategoryName(oldCategoryName, newCategoryName)
{
// get div parent
var parentDiv = $("#selectedId");
parentDiv.find('*').each( function(el,key) {
alert(el+" --");
el.each( function(el,key) {
// i get just numbers here, and undefined on everything
// i try to access
});
});
}
Any ideas? What am i doing wrong here? Is there a concept that i am missing?