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

  • Home
  • SEARCH
  • 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 7614253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:21:25+00:00 2026-05-31T02:21:25+00:00

I have a div which get’s its content loaded through ajax .load(ajaxcontent.php). Inside this

  • 0

I have a div which get’s its content loaded through ajax .load(“ajaxcontent.php”).

Inside this div, we produce many other divs. I want to get the content of one of these divs.

I’ve tried var insidecontent=$(‘#topdiv’).html(); but it returns null.

is there a trick to getting such values?

index.html

<div id="news"></div>

ajaxcontent.php

<div id="topdiv">Hello World</div>
<div id="middiv">This is the mid div</div>
<div id="botdiv">This is the bottom</div>

javascript:

$("#news").load("ajaxcontent.php");

$(document).delegate("#total", "keyup", function (e) {
        if(e.which!=13){
            var insidecontent=$('#topdiv').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-05-31T02:21:27+00:00Added an answer on May 31, 2026 at 2:21 am

    Are you accessing the content after the load function completes its execution ?

    $("#firstDiv").load("serverpage.aspx",function(){
    
          // Now access the content
           var insideContent=$("#topDiv").html();
    
    });
    

    EDIT : After the op posted his code

    wrap the delegate binding inside document.ready like this

    $(function(){
      $(document).delegate("#total", "keyup", function (e) {
            if(e.which!=13){
                var insidecontent=$('#topdiv').html();
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have div which height changes depending on its content. Div element is located
Basically, I have one div(divNew) which is being populated with content from another page(thread.php)
I have a div which I have attached an onclick event to. in this
I have a div in which a page is loaded with the DojoX Layout
I have a menu div which has a dark background. Inside it, I have
I have a div which is set to overflow:scroll;. I get scrollbars which is
Hi I have a simple sidebar inside a div which has height:100% and I
I have this div which pops up when an action is triggered. When I
I have something like this: I am using Ajax.BeginForm and its updatetargetid is a
Assuming I have the following html div which I want to replicate its children,

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.