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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:07:29+00:00 2026-06-04T12:07:29+00:00

i have a select tag , when its value changes i want to get

  • 0

i have a select tag , when its value changes i want to get some data from database according to that new value , and then put these new data on a new div , this div contains an close sign when user click it , the new div will hide , i did that using jquery , everything is working good except hiding the new div , my jQuery for close the new div was working good , but now no , i don’t think that i did wrong in jQuery , but i don’t know where is my mistake , would u help me please

jQuery code

$(document).ready(function(){
$("#aqIoQuesSelector").on("change",function(){
        var IO = $("#aqIoQuesSelector").val();
        $("#aqSugInfo").html('<div class="closeSign1"></div>');
        $.getJSON("http://localhost/Mar7ba/InformationObject/giveContenfForIO/"+IO+"/TRUE",function(data){
            if(data.length>0){
                $("#aqSugInfo").css("text-align","right");
                for(var i=0;i<data.length;i++){
                    $("#aqSugInfo").append('<p><span class="aqoneContenSug">'+data[i]+'</span></p>');
                }
            }else{
                $("#aqSugInfo").append('<span class="successMessage">no suggesiont</span>');
            }
            $("#aqSugInfo").css("display","block");
        }); 
    });
});

$(document).ready(function(){
    $('.closeSign1').on('click', function() {
        $(this).parent().hide();
    });
});

$html code#

<div id="addQuestion1" class="container">
    <ul>
        <li>
            <label class="Paragraph">Question</label>
            <p>
                <label>Text</label>
                <input id="aqQuestionText"type="text" class="longInput1"/>
            </p>
            <p>
                <label>Answer</label>
                <input id="aqQuestionAnswer"type="text" class="longInput1"/>
            </p>
            <p>
                <label>Is Existed ?</label>
                <input type="button" value="check" class="button1" id="aqQuestionSug"/>
            </p>
            <div id="aqSugQues" class="SuggestionsContainer">
                <div class="closeSign1"></div>
            </div>
        </li>
        <li>
            <p><label class="Paragraph">Choices</label></p>
            <p>
                <label>First Choice</label>
                <input type="text" class="longInput1" name="choice1"/>
            </p>
            <p>
                <label>Second Choice</label>
                <input type="text" class="longInput1" name="choice2"/>
            </p>
            <p>
                <label>Third Choice</label>
                <input type="text" class="longInput1" name="choice3"/>
            </p>
        </li>
        <li id="aqQuestionIoli">
            <label class="Paragraph">Question IO</label>
            <p>
                <label>Concept</label>
                <select class="ConceptSelector1"></select>
            </p>
            <p>
                <label>IO</label>
                <select id="aqIoQuesSelector"></select>
            </p>
            <p>
                <label>Info</label>
                <input type="text" class="longInput1"/>
            </p>
            <div id="aqSugInfo" class="SuggestionsContainer">
                <div class="closeSign1"></div>
            </div>
        </li>
        <li id="aqAnswerIoli">
            <label class="Paragraph">Answer IO</label>
            <p>
                <label>Concept</label>
                <select class="ConceptSelector1"></select>
            </p>
            <p>
                <label>IO</label>
                <select id="aqIoAnswerSelector"></select>
            </p>
        </li>
        <li>
            <label class="Paragraph">Hints</label>
            <p>
                <label>First Hint</label>
                <input type="text" class="longInput1"/>
            </p>
            <p>
                <label>Second Hint</label>
                <input type="text" class="longInput1"/>
            </p>
            <div id="aqSugHints" class="SuggestionsContainer">
                <div class="closeSign1"></div>
            </div>
        </li>
        <li>
            <label>Type</label>
            <select class="TypeSelector"></select>
        </li>
        <li>
            <input type="submit" value="save" class="button1"/>
        </li>
    </ul>
</div>

notice that the sign close is used three time here , it works for the first time at the div aqSugQues , but doesn’t work at the div aqSugInfo nor the div aqSugHints

the ajax is working good and i print the results

thanks for helping

  • 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-04T12:07:30+00:00Added an answer on June 4, 2026 at 12:07 pm

    This line:

    $("#aqSugInfo").html('<div class="closeSign1"></div>');
    

    is replacing the contents of the div with a new button that doesn’t have the click-event bound, so every time you update, that button will lose its binding.

    You might try wrapping your dynamic content in a container that you can easily remove, or do something like

    $("#aqSugInfo").children(':not(.closeSign1)').remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following SQL: SELECT * FROM [Database].dbo.[TagsPerItem] INNER JOIN [Database].dbo.[Tag] ON [Tag].Id
I have one doubt that how to get other control's value when we select
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
I have a easy select tag: <select> <option></option> <option></option> </select> Then I want use
In the settings.php i have some input for the realname,hobby,city and select tag for
I have div tag, I have a free text(on its own) in that tag.
i have a select tag,... like this,.. <select style=max-width:150px> <option value='1'>bla bla bla bla
I have a drop down list's select tag that looks like this: <select name=MyName
I have the following function from that I am setting an attribute of select
Suppose I have a dropdown (select tag) with 3 values. Our first option has

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.