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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:38:19+00:00 2026-05-31T20:38:19+00:00

I downloaded the File upload script called Simple Photo Manager. Since I’m more familiar

  • 0

I downloaded the File upload script called Simple Photo Manager.
Since I’m more familiar with jQuery functions I want to use them in combination with the already existing JS code from that script.

I basically want to hide the Delete button when it’s clicked.
Why is the Delete button not being hidden after I click on it?
(Note: the JS files are correctly included into the HTML file)
Also, the delLink.removeChild and delLink.appendChild are useless here because it was originally intended for a Delete/Restore switch link, but I decided to go for a button instead.

Thanks a lot if you can help me.

The html code is:

<input type='button' id='deleteit' onClick="deleteLinkOnClick
(this, 'delFlag<?=$imgid?>')">

The JS code for creating that element when an image is uploaded is:

var image_del_link = par.createElement('input');
image_del_link.type = "button";
image_del_link.value = "Delete";
imgdiv.appendChild(image_del_link);

The function for the onclick is: (I tried to write the jQuery function at the bottom)

function deleteLinkOnClick(delLink, delFlag) {
    var par = window.document;
    var imgDiv = delLink.parentNode;
    var image_hidden = delFlag == '' ? imgDiv.childNodes[2] : par.getElementById(delFlag);

    if (image_hidden.value == '1') {

        image_hidden.value = '0';
        delLink.removeChild(delLink.childNodes[0]);
        delLink.appendChild(par.createTextNode("Restore"));
        delLink.style.color = '#FF0000';
    }
    else {
        image_hidden.value = '1';
        delLink.removeChild(delLink.childNodes[0]);
        delLink.appendChild(par.createTextNode("Delete"));
        delLink.style.color = '#64B004';
    }

    $(document).ready(function(){
        $(image_del_link).click(function(){
            $(this).hide();
            });
        });
}
  • 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-31T20:38:20+00:00Added an answer on May 31, 2026 at 8:38 pm

    Here it is.

    $("#deleteit").click(function(){
        $(this).hide();
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following jQuery ( https://github.com/blueimp/jQuery-File-Upload ) script to upload files. This script
I have used the a jquery script that is used to upload files: http://aquantum-demo.appspot.com/file-upload
I have developed a download/upload manager script. When I upload a file via POST
I have implemented a simple file upload-download mechanism. When a user clicks a file
have downloaded Orca to edit an MSI file. I want to remove some banner
I wanted to design a simple site where one person can upload a file,
I have a small php script which allows me to upload image file on
I am trying to upload a file of 1GB size using php script and
I have a standard file upload script using this script. When the upload is
I'm trying to implement the jQuery File Upload Widget on my website. What I

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.