Determining if a div contains a table element in JQuery
For my accordion, every time the user clicks on the title, I want to see if the accordion content contains a table, and if not, generate it and add it to the accordion content. But how do you check if the current element contains a specific element type?
<div class="a-header">
<ul><li></li></ul>
</div>
<div class="a-content">
</div>
$('.a-header').click(function(){
var currentHeader = $(this).next();
//if currentHeader contains 'table'
});
Thanks.
+2
a source to share