Facing some issues while extracting all inner HTML of a tag including those which are direct children as well as indirect children, i.e. inner HTML of some other tags that are children of the parent div.
For example, given the below HTML,
<div class = "ace_text">
<div class = "ace_line">
<span class = "ace-keyword"> rule_1 </span>
some_sample_rule_1
</div>
<div class = "ace_line">
<span class = "ace-keyword"> rule_2 </span>
some_sample_rule_2
</div>
<div class = "ace_line">
<span class = "ace-keyword"> rule_3 </span>
some_sample_rule_3
</div>
</div>
I want to extract exactly the following as a string:
rule_1
some_sample_rule_1
rule_2
some_sample_rule_2
rule_3
some_sample_rule_3
$('.ace_text').text()
– Rory McCrossan