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 7717485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:54:42+00:00 2026-06-01T02:54:42+00:00

Hey this is my first question on this website. Im creating a webpage for

  • 0

Hey this is my first question on this website.

Im creating a webpage for a client, this page needs to be loaded in 1 time and the user can navigate throught the different parts of the website using arrows, these arrows will activate a jquery script that will switch the HTML of a page…

This is the Javascript i use:

<script type="text/javascript">
    function loadPage(div){
        if($("#page_"+div).length != 0){//if the page div exitst, else return false.
            var image = $("#image_"+div).attr('src');
            var title = $("#title_"+div).html();
            var info = $("#info_"+div).html();
            $("#page").html('<img src="'+image+'" />');
            $("#title").html(title);
            alert($("#pageInfo").html());
            return true;
        }else{
            return false;
        } 
    }
    $(document).ready(function(){
        var div=1;   
        loadPage(div);
        //<buttons>
        $("#btnHome").click(function(){
            div = 1;
            loadPage(div);
        });
        $("#btnPrevious").click(function(){
            var success = loadPage((div-1));
            if(success == true){
                div--;
            }
        });
        $("#btnNext").click(function(){
            var success = loadPage((div+1));
            if(success == true){
                div++;
            }
        });
        $("#btnInfo").click(function(){
            $(".pageInfo").slideDown('fast');
        });
        $("#btnClose").click(function(){
            $(".pageInfo").slideUp('fast');
        });
        //</buttons>
    });
</script>

And this is the html:

 <div id="page">
    <div id="pageInfo">
        a
    </div>
</div>

When i alert the variables i’ve set in Javascript i get the wished result, but when i alert:

alert($("#pageInfo").html());

i get ‘null’ as a result, oh and JQuery is included.

Can someone help me out with this information?
Or did i miss essential parts.
-edit:
the rest of the HTML (sourcecode).

<div id="wrapper">



            <div class="pages" id="page_1">

                <h1 id="title_1">Startpunt</h1><img class="pagesImage" id="image_1" src="http://www.naviplan.nl/files/routefiles/1/1/67.jpg">               

                <div class="pagesInfo" id="info_1">INFO TEXT                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>



            <div class="pages" id="page_2">

                <h1 id="title_2">Geen titel.</h1><img class="pagesImage" id="image_2" src="http://www.jomaverhuur.nl/wp-content/uploads/2011/02/no-image.gif">               

                <div class="pagesInfo" id="info_2">                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>



            <div class="pages" id="page_3">

                <h1 id="title_3">Geen titel.</h1><img class="pagesImage" id="image_3" src="http://www.jomaverhuur.nl/wp-content/uploads/2011/02/no-image.gif">               

                <div class="pagesInfo" id="info_3">                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>



            <div class="pages" id="page_4">

                <h1 id="title_4">Geen titel.</h1><img class="pagesImage" id="image_4" src="http://www.jomaverhuur.nl/wp-content/uploads/2011/02/no-image.gif">               

                <div class="pagesInfo" id="info_4">                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>



            <div class="pages" id="page_5">

                <h1 id="title_5">Geen titel.</h1><img class="pagesImage" id="image_5" src="http://www.jomaverhuur.nl/wp-content/uploads/2011/02/no-image.gif">               

                <div class="pagesInfo" id="info_5">                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>



            <div class="pages" id="page_6">

                <h1 id="title_6">Geen titel.</h1><img class="pagesImage" id="image_6" src="http://www.jomaverhuur.nl/wp-content/uploads/2011/02/no-image.gif">               

                <div class="pagesInfo" id="info_6">                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>



            <div class="pages" id="page_7">

                <h1 id="title_7">Eindpunt</h1><img class="pagesImage" id="image_7" src="http://www.naviplan.nl/files/routefiles/1/17/finish56.png">               

                <div class="pagesInfo" id="info_7">                    <a data-role="button" id="btnClose" href="#" data-icon="arrow-u">Sluiten</a>

                </div>

            </div>

        <div data-role="header" data-position="inline" data-position="fixed" >

    <a id="btnHome" href="#" data-icon="home">Homepage</a>

    <h1 id="title"></h1>

</div>

Greetings,
Harm.

(im sorry if this question is already asked, but i dont know where to search for.)

  • 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-01T02:54:44+00:00Added an answer on June 1, 2026 at 2:54 am

    It seems from your code at top that pageInfo is class so you can’t alert it using #pageInfo, $("#pageInfo") is used for ID and $(".pageInfo") for class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey there guys, this is my first question on Stack Overflow. I figured this
Hey stackoverflow - This is my first question here. I have 2 tables in
Hey, first time poster on this awesome community. I have a regular expression in
Hey everyone.. This is my first time writing an ASP.NET MVC web app, and
Hey, first of all thanks for helping me out with this (probably stupid) question
Hey, first time asking a question on Stack Overflow, so go easy on me!
Hey guys, quick question, just trying to filter a user's first and last name
Hey guys, This is my first time making an app with any kind of
Hey folks, this question can't be too complicated. Please provide a solution to at
Hey, long time listener first time caller, and I'm asking a question related to

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.