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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:18:22+00:00 2026-05-31T22:18:22+00:00

I am a beginner in JavaScript but I wrote two functions that is meant

  • 0

I am a beginner in JavaScript but I wrote two functions that is meant to keep track of people who have joined a certain club. The JavaScript function is supposed to reload the page continuously to show current membership and especially if a member has been removed from the club.

The two functions I wrote are:

function show_remove()
{
var r=confirm("Press OK to remove or CANCEL to undo.");
if (r==true)
  {
  alert("Removed");
  }
else
  {
  alert("Member still part of club");
  }
}

And

function members()
    {
        var i;
        for (i=0; i<mems.length; i++)
        {
            if (mems[i].isMemberofClub)
            {
                var link = '<a href=' + mems[i].l + '>' + mems[i].n + '</a>';
                document.write(link)
            }
        }
    }

Ideally, these two functions should be linked in some way so that when the manager clicks on the button to remove someone, isMemberofClub becomes false and the person is removed from the list of members. The page then shows the updated list. However, I tried several combinations but the page fails to update the list no matter what I try. Thanks in advance.

  • 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-31T22:18:24+00:00Added an answer on May 31, 2026 at 10:18 pm

    In the HTML of your page you should create a DIV with an id of members like this

    <div id='members'></div>
    

    Then change your javascript function so that it changes the contents of that div instead of using document.write. I also set it to empty before starting so it is all refreshed.

    function members()
    {
        var i;
        document.getElementById("members").innerHTML = "";
        for (i=0; i<mems.length; i++)
        {
            if (members[i].isMemberofClub)
            {
                var link = '<a href=' + mems[i].l + '>' + mems[i].n + '</a>';
                document.getElementById("members").innerHTML += link + '<br />'; 
            }
        }
    }
    

    In your function which removes members, when it removes them you should call your members() function to refresh the contents of the DIV.

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

Sidebar

Related Questions

I am a beginner programmer. I have a limited knowledge of javascript, but I
I'm totally beginner in java. In javascript i have this regex: /[^0-9.,\-\ ]/gi How
Attempting a beginner's tutorial. I have the following in my head: <script type=text/javascript charset=utf-8
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
I am a COMPLETE beginner at JQuery (and javascript in general) but I'm having
I'm a complete beginner when it comes to Jquery, Javascript etc but I've managed
I'm beginner in DOM javascript, So I have such a question. I have html
i have a javascript code that requests a php page to provide it with
this is a very beginner question but I don't know javascript, I only wants
I am a beginner to Javascript. And when I was practicing I have noticed

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.