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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:54:10+00:00 2026-06-01T19:54:10+00:00

I am trying to add a button from a javascript function (with the innerHTML

  • 0

I am trying to add a button from a javascript function (with the innerHTML method) that has another function as the onClick function. This onClick function has to take multiple parameters:

area.innerHTML += "<input type='image' src='images/del.jpg' width='15' height='15' " +
           "onClick='del(" + info['_id'] + "," + key + "," + value + ")' />";

This is (I think) the most logical way to do this, but when I try to click the button there is no functioncall. This works with one single argument, so the problem has to be in the combination of the parameters with the “,”.
Does anybody know how to solve this?

update
The del function is a temporary testfunction

function del(id, key, value) {
    console.log(id + key + value);
}
  • 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-01T19:54:11+00:00Added an answer on June 1, 2026 at 7:54 pm

    I think you just need your variabled to be passed as strings. Edit the onclick even to this:

    onClick='del(\"" + info['_id'] + "\",\"" + key + "\",\"" + value + "\")' />"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a button to add another input box every time
Im am trying to add a check box that will enable/disable the edit button.
I'm trying to build some JavaScript in MooTools that fetches table row markup from
I took this code from another question and now I'm trying to get the
I'm trying to add a custom button to the button panel of jQuery's datepicker.
I am trying to add a transparent button bars at the top and bottom
I am trying to add Become-a-Fan button to my 2008 asp.net website (vb) Here
I'm trying to add the Twitter Share button to my website. I've gone to
I am trying to set up an add-tab button in a Gtk::Notebook (gtkmm). I
I am trying to add a simple log in with Facebook button to my

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.