I am experiencing an issue with the following HTML element that has an onclick() function dynamically attached. When trying to call the function, it throws an error stating that "ST" is not defined. The variable passed as name is something like "ST-123". Can someone assist with resolving this error?
hubName = "ST-123" ;
IdCell.append("<button type='button' class='btn-link' style='float:right; margin-right:-6px; margin-top:-11px;' onclick='unPair($(this),"+name+")'>
<img src='../images/link-minus.png'> </button>");
In this scenario, the idCell represents one of the table cells.