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

The Archive Base Latest Questions

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

select: function (event, ui) { var staffItem = new Object(); staffItem.StaffId = ui.item.id; staffItem.Name

  • 0
select: function (event, ui) {

        var staffItem = new Object();


        staffItem.StaffId = ui.item.id;
        staffItem.Name = ui.item.name;
        staffItem.Photo = ui.item.image;
        staffItem.Email=ui.item.email;
        staffItem.Mobile=ui.item.mobile;          

              var data = "<div><table width='100%'><tr><td align='right' ><div class='close16'/></td></tr></table><div><table><tr><td rowspan='4' width='50px;'><img src='" + staffItem.Photo + "' Width='48' Height='48'  /></td><td>" + staffItem.Name + " ( " + staffItem.StaffId + " )</td></tr><tr><td><table cellpadding='0' cellspacing='0'><tr><td>" + staffItem.Email + "</td><td>&nbsp;|&nbsp;</td><td>" + staffItem.Mobile + "</td></tr></table></td></tr></table></td></tr></table></div></div> ";
                $('#staffInCharge').css('background-color','#FFAA55');
                $('#staffInCharge').append(data);

am using this code to append staff details into a div, and in the close16 class am using a image file(for cross mark to delete the data), if I click the cross mark the appended data should be deleted, how can I do that, and also when I append the new data its appending one by one(below of existing data) i need to append it to the right side, how can I do this.

  • 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-31T23:07:26+00:00Added an answer on May 31, 2026 at 11:07 pm

    For deleting the data, you could do something like this:

    $(document).on('click', '.close16', function() {
        $(this).parentsUntil('div').remove();
    });
    

    As for appending data, it depends a bit on what your DOM looks like, and exactly what you want to achieve. You might want to have a look at insertAfter and insertBefore for controlling exactly where your data is added. Making things appear “to the right side” may be more a question of the styles of the elements you’re inserting, than where in the DOM you’re inserting them.

    .append adds content to the bottom of a container as far as your markup is considered. Whether or not this is the same thing as items physically appear below previous items in the container depends on the properties of these elements.

    If you’re adding a DIV after another DIV, then it will, by default, appear below the former, but this has more to do with the element’s display-mode than with its position in your code. Example.

    If the DIV elements were of a different display mode, for instance inline-block, they would appear to the right of the previous element. Example. Note that the JavaScript doesn’t change.

    However, if you instead wanted to position your DIVs with float: left;, you might find that you wanted to insert the elements not at the bottom of the container, but before a clear: both-element, that would always be at the bottom. You would then have to use something like insertBefore. Example.

    Which exact approach works best for you depends on very many aspects of your markup and styles. Saying that you want something “to the right side” does not provide us with enough information to assist you in this regard.

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

Sidebar

Related Questions

My javascript $(.controls).click(function(event) { var div = $(event.target).parents(.controls); var a = $(div).find(tr .select); return
I'm using this snippet to bind on select event: $(#myTabControl).tabs({ select: function(event, ui){ var
$( '#xxx' ).tabs({ select: function(event, ui) { var theSelectedTab2 = ui.index; if (theSelectedTab2 ==
$(#txtcode).autocomplete({ minLength: 1, source: /AC/student.php?searchMode=''&Stno=+$(#txtcode).attr(value), select: function(event, ui) { var label= ui.item.label; var value=
The event $('#myInput').live('keyup blur', function(event) { //... } is not triggered when I select
<script type=text/javascript> $(document).ready(function() { //select all the a tag with name equal to modal
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
With this code: function setupRow(event, ui) { var textbox, // how do i get
$(#shout_field).live('keydown', function (event) { if (event.keyCode === $.ui.keyCode.TAB && $(this).data(autocomplete).menu.active) { event.preventDefault(); } }).autocomplete({
I'm quite new with javascript and I don't understand this problem: $(function() { 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.