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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:58:39+00:00 2026-06-04T07:58:39+00:00

I have an HTML div section with an empty table: <div id=report_result class=container> <table

  • 0

I have an HTML div section with an empty table:

<div id="report_result" class="container">
        <table cellpadding="0" cellspacing="0" border="0" class="dataTable" id="example">
        </table>
</div>

Now I dynamically create the table headers and body which is based upon params opted by use in the page:

function runreport(datastring)
{
        var tables_header = $('<thead><tr><th>Flow State</th><th>Flow Logging Id</th><th>Co-relation Id</th></tr></thead><tbody></tbody>');
        ('#example').empty(); // added later
        tables_header.appendTo('#example');
}

There is a ‘Run Report’ button which on click calls ‘runreport’ function with user selected options.

The first time table comes up fine but if in case user just re-clicks the ‘Run Report’ button content of the table is getting duplicated and so on. So on each click the table header gets added.

As such I though of removing all the tables headers, row, footers etc before creating the same:

But I receive an error like even at very first time:

"#example".empty is not a function
[Break On This Error]   

('#example').empty();

But http://api.jquery.com/empty/ states this method – then why I am getting this error?

  • 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-04T07:58:41+00:00Added an answer on June 4, 2026 at 7:58 am

    You forgot the $ in front of the parentheses:

    $('#example')...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML : HTML : <div class=stave-container> <section id=Captcha></section> <div id=horiz_container_outer> <img
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
I have the following html <div class=section> <div>header</div> <div> contents <div>sub contents 1</div> <div>sub
I have following HTML <div id=header1 class=toggle>Section 1 : Create an account</div> <div id=section1>
I have following HTML code: <section class=indent-1> <!-- Section 1 --> <section> <div>Some content</div>
I have html like: <fieldset> <div> <ul> <li class=test> This paragraph contains a very
I have this html: <div class=foo parent> <div class=child></div> </div> with some css: .foo{
I have this HTML code: <div class='com_box'> <div class='com_box_c'> <div class='com_box_info'> <a id='quote'>quote</a> </div>
I have this html structure: <div id=home> <div class=section_header> <h1 class=left data-target=newest><?=lang('home_newest');?></h1> ... </div>
I have this html page which globally exists of div , section , 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.