Passing dynamic parameter to a JavaScript function using innerHTML
- by user958263
I am having issues passing a dynamic parameter to a JavaScript function using innerHTML.
Included below is the current code that I am using:
var name = "test";
frm.innerHtml = '<button name="close" id="close" title="Cancel" type="button"
onclick="closeTab('+name+');">Return</button>';
When I debug the code of the CloseTab() function, the parameter specified by the name variable is null.
I believe there is a problem with the declaration of the value while modifying the innerHTML property.
Any help would be greatly appreciated.
Thanks