user3874356 user3874356 - 1 year ago 34
jQuery Question

Fetch html content of child tag inside li

I have a list like:

<ol id="id1">
<li><strong>aaa</strong><em>bbb<br />ccc</em></li>
<li><strong>111</strong><em>222<br />333</em></li>

How do I get the html content of
tag within each

I tried using jQuery's
method but is behaving inconsistently on android html5 app I'm trying to make. Android 5.1 above are able to read that well, but android 4.4.2 device doesn't doesn't display anything.

Is there an alternate way of getting html please?


var liElements = document.getElementById("id1").getElementsByTagName("li");
for(var i=0;i<liElements.length;i++){