Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:14:17+00:00 2026-06-18T06:14:17+00:00

I am creating a webpage using jQuery mobile.i am new to this technology. I

  • 0

I am creating a webpage using jQuery mobile.i am new to this technology. I want to navigate to another page by list item click. while going to second page i want to pass the text value from list item and list item id for displaying it. Can anyone guide me?

My HTML code is:

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />

    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>

    <title>Demo Page</title>

    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>

    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css"/>

    function onDeviceReady() {}
    document.addEventListener("deviceready", onDeviceReady, false);

    function Button_onclick() {

    for(i=0; i < 3; i++){
            $("#numbers").append('<li id="'+i+'" ><a href="#page2#">' +i+'</a></li>' );
        $('#numbers').listview('refresh');
    }
}
</script>

</head>

<body>

    <div >
        <input id="Click_Button" type="button" value="Submit" onclick="Button_onclick()" />
    </div>

    <div id="divList" data-role="content">
        <ul id="numbers" data-role="listview" data-inset="true"> </ul>
    </div>

    </div>
    <div data-role="page" id="page2">

    <div data-role="header">
    <h1>Page Two</h1>
        </div>

        <div data-role="content">
    <p>Welcome to page 2.</p>
    </div>

    </div>

</body>

</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:14:19+00:00Added an answer on June 18, 2026 at 6:14 am

    This must works. I wish it will be useful.

    index.html:

    <body>
    <div id="page1" data-role="page" data-theme="a" data-rockncoder-jspage="page1">
        <header data-role="header">
            <h1>Page 1</h1>
        </header>
        <section data-role="content" id="pages_list"></section>
        <div>
            <button id="send_btn">SEND</button>
        </div>
    </div>
    
    <div id="page2" data-role="page" data-theme="b" data-rockncoder-jspage="page2">
        <header data-role="header">
            <h1>Page 2</h1>
        </header>
        <div id="p2_id_selected"></div>
        <div id="p2_text_selected"></div>
    </div>
    
    <div id="page3" data-role="page" data-theme="b" data-rockncoder-jspage="page3">
        <header data-role="header">
            <h1>Page 3</h1>
        </header>
        <div id="p3_id_selected"></div>
        <div id="p3_text_selected"></div>
    </div>
    
    <script src="scripts/hideAddressBar.js" type="text/javascript"></script>
    <script src="scripts/app.js" type="text/javascript"></script>
    

    main.js:

    num_pages = 3;
    page_selected = 0;
    text_selected = "";
    
    $(document).delegate('.ui-page', 'pageshow', function () {
        loadList();
    });
    
    function loadList()
    {   
        $("#pages_list").append("<ul><fieldset data-role='controlgroup' id='radios'></fieldset></ul>");
        $("#radios").empty();
        for (var i = 0; i < num_pages; i++)
        {
            var id = "page_id"+(i+1);
            $("#radios").append("<input type='radio' name='choice' data-theme='c' id='" + id + "' />");
            $("#radios").append("<label for='" + id + "'>"+"Page "+(i+1)+"</label>");
            $("#" + id).checkboxradio();
        }
        $("#radios").controlgroup("refresh"); 
    };
    
    $(function(){
        $( "#send_btn" ).click(function(e)
        {
            if( $('#page_id2').is(':checked') )
            {
                page_selected = 2;
                text_selected = $('input[name=choice]:checked + label').text();
                $.mobile.changePage( "#page2", {
                    transition: "slide",
                    role: "page",
                    reverse: false,
                });
            }else if( $('#page_id3').is(':checked') )
            {
                page_selected = 3;
                text_selected = $('input[name=choice]:checked + label').text();
                $.mobile.changePage( "#page3", {
                    transition: "slide",
                    role: "page",
                    reverse: false,
                });
            }
        });
    });
    
    $("#page2").live('pageshow', function() {
       $("#p2_id_selected").text(page_selected);
       $("#p2_text_selected").text(text_selected);
    });
    
    $("#page3").live('pageshow', function() {
       $("#p3_id_selected").text(page_selected);
       $("#p3_text_selected").text(text_selected);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a small web page using jquery-ui-1.8 which is having a frameset and
I am creating a website using jQuery Mobile and I am interested in Ajax
I'm creating a sample webpage with button..this webpage am calling in Android using webview.
I'm trying to create a dynamic webpage using include() in PHP. This PHP page
I'm creating an autocomplete on a web page using jQuery's AutoComplete plugin. Does anyone
I'm creating an iPad app using Jquery Mobile, and would like to create a
I am creating a webpage which is using asp .net as its backend. I
I am creating web page using asp.net. Is it possible to remove/hide the browsers
I'm creating a webpage which has several fields. I do not want the php
I'm creating a webpage which uses jquery.transit plugin. I download the .js file and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.