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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:16:54+00:00 2026-06-15T15:16:54+00:00

HTML: <script src=../../Scripts/notificator.js type=text/javascript></script> <span id=popUpMessageBoard/> <button onclick=success(‘message’, ‘popUpMessageBoard’)>Add</button> <button onclick=remove(‘popUpMessageBoard’)>Remove</button> javascript: success =

  • 0

HTML:

<script src="../../Scripts/notificator.js" type="text/javascript"></script>

<span id="popUpMessageBoard"/>
<button onclick="success('message', 'popUpMessageBoard')">Add</button>
<button onclick="remove('popUpMessageBoard')">Remove</button>

javascript:

success = function (messageToApply, elementIdToApplyMessages) {
    $('#' + elementIdToApplyMessages).append('<strong class="notification" style="color:blue">' + messageToApply + ' </strong>');
};

remove = function (elementId) {
    $('#' + elementId).remove('.notification');
}

The Add button appends elements to the popUpMessageBoard span element. On clicking the delete button I want all elements with the .notification class to be removed from the parent span element. What am I missing ?

  • 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-15T15:16:56+00:00Added an answer on June 15, 2026 at 3:16 pm

    The .remove() method will remove elements that are in the matched set. When you pass a selector to it, it simply filters the matched set. In your case, this filtering will leave you with an empty set of elements and nothing will get removed.

    You need to remove descendants of elements in the matched set. You can use .find() (or one of the numerous other methods available) to get those descendants:

    $('#' + elementId).find('.notification').remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My html code has many anchors and links such as : <script src=/Common/Scripts/jquery-1.4.4.min.js type=text/javascript></script>
Possible Duplicate: What is my script src URL? I have situation: <script type=text/javascript src=http://server/some.js>
<script src = https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js></script> <script type=text/javascript> //waits till the document is ready $(document).ready(function() {
I'm attempting to select all <script type=text/html> tags in a page. I use <script>
I'm looking at the http://code.google.com/chrome/extensions/contentSecurityPolicy.html documentation and seeing: { ..., content_security_policy: script-src 'self' https://example.com;
I have a file called src.js which has all the scripts for my html
I'm trying to use enhance.js to load scripts only on desktops : http://dl.dropbox.com/u/426954/allora/index.html <script>
i have a html page with 2 embed pages <body> <embed src =toolbar.html type=application/xhtml+xml
I'm returning HTML (which includes IMG SRC attributes) from my php scripts and I
Suppose I get, on a page, this simple html/script : <a id=hey href=#>try</a> var

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.