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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:19:51+00:00 2026-05-28T16:19:51+00:00

function check(child) { var y = "<span onclick=remove(" + child + ") onmouseover=’hove(this)’>x</span>"; child

  • 0
function check(child) { 
    var y = "<span onclick=remove(" + child + ") onmouseover='hove(this)'>x</span>";
    child = child + " " + y;
    send = '<span  class="elements" >' + child + '</span>' ;
 }

 function remove(child) {
    // some of mycode;
 }

These are the 2 functions I have. child is a variable passed from one function to the check() function and again I’m trying to pass this child value to remove function, adding to the onclick event of span tag but it does not seem to work. I am unable to get out of this.

I want to add onclick event to the span tag and it should pass the child value to remove function.

  • 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-28T16:19:53+00:00Added an answer on May 28, 2026 at 4:19 pm

    Remove the “send”. Directly assign to innerHTML:

    document.getElementById(divid).innerHTML = '<span  class="elements" >' + child + '</span>' ;
    

    Edited:

    I am guessing that your end goal is to have a span tag that looks like this?

    <span class="elements" >
        ABC <span onclick="remove('ABC')" onmouseover='hove(this)'>x</span>
    </span>
    

    Then the code may be:

    function check(child) { 
        var y = "<span onclick=\"remove('" + child + "')\"" onmouseover='hove(this)'>x</span>";
        child = child + " " + y;
        send = '<span  class="elements" >' + child + '</span>' ;
    

    }

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

Sidebar

Related Questions

I have used Javascript onlaod like this: function check() { var pic = new
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
ok quick scenario: html: <span class=answer>blah<input type=radio value=1></span> jquery: $(span.answer).click( function() { check =
function check(id){ var _id = document.getElementById(id); url = test.php?check=1&id= + _id; } i want
$(document).ready(function() { //Check City Value var city_value = parseInt($(#city).val()); if( city_value == 0) {
I have a structure like this: <ul id="mycustomid"> <li><a>Item A</a> <ul class="children"> <li><a>Child1 of
Hello i have a function as following: private function seatClickHandler(e:MouseEvent):void{ var check:Check = new
I tried to write a function to check key code with JavaScript. It's working
In SQL Server you can use the IsNull() function to check if a value
I use the following javascript function, function get_check_value(formId,checkboxId,TxtboxId) { alert(formId); var c_value = ;

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.