How to get html from element by id with jQuery

Albertba

New Member
I have simple list:\[code\]<ul id="tabs_nav"> <li id="t_00">data</li> <li id="t_01">data</li> <li id="t_02">data</li> <li id="t_03">data</li></ul>\[/code\]Now: How do I get the html of the first element, depending on what is ID. I would add that all of ID's change dynamically with the click of the button. This is my code:\[code\]btn.on('click',function(){ var ladder_nav_tabs = $('#tabs_nav'), first_ladder_element_inset_id = ladder_nav_tabs.find('li').first().attr('id'), first_ladder_element_inset_html = ladder_nav_tabs.find(first_ladder_element_inset_id).html(); console.log(first_ladder_element_inset_html);});\[/code\]Thx for help.
 
Back
Top