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.
Remove the “send”. Directly assign to innerHTML:
Edited:
I am guessing that your end goal is to have a span tag that looks like this?
Then the code may be:
}