apostolish
apostolish

Reputation: 11

Display the content of <ul> tag

Why this html script doesn't work well? I can see the content of the h1 tag to the browser but i can't see the the content of the ul tag.

<!DOCTYPE html>
<html>
    <head>
        <title>Miletracker</title>
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css"/>
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
    </head>
    <body>
        <div data-role="page" id="home">
            <div data-role="header" data-theme="b">
                <h1>Miletracker</h1>
            </div>
        </div>
        <div data-role="navbar">
            <ul>
                <li><a href="#home" data-transition="none" data-icon="home">Home</a></li>
                <li><a href="#add" data-transition="none" data-icon="plus">Add Run</a></li>
            </ul>
        </div>
    </body>
</html>

I found it.

<div data-role="page" id="home">
   <div data-role="header" data-theme="b">
       <h1>Miletracker</h1>
   </div>
   <div data-role="navbar" >
       <ul>
          <li><a href="#home" data-transition="none" data-icon="home">Home</a></li>
          <li><a href="#add" data-transition="none" data-icon="plus">Add Run</a></li>
        </ul>
   </div>            
</div>

Thank you very much

Upvotes: 1

Views: 80

Answers (2)

flashdream
flashdream

Reputation: 21

navbar is behind #home. #home has position: absolute and it covers the rest of the page.

Just add position: relative; to navbar

Upvotes: 2

Rajesh
Rajesh

Reputation: 662

according to the jquery ul tags

$('#result').append(
$('#thelist').find('li').filter(function() {
    return $(this).find('ul').length === 0;
}).map(function(i, e) {
    return $(this).text();
}).get().join('<br/>')

);

demo at here enter link description here and

This link may helpful for you

Upvotes: 0

Related Questions