My javascript creates a line of html.
That html has an onclick event call to openSingle().
I need to pass a variable into that function.
onclick="openSingle('+findID+')"
When I check the dev panel when it runs, i get
onclick="openSingle(WP0100200-3a)"
The only thing that is missing is the quotes around the id.
But if i try to code in the quotes, it breaks the html and then puts everything out of order.
Here is my line of code and all the pertaining variables.
var iconImage = '<img src="../../resources/images/annotation-icon.png" style="float:left; margin-left:20px; margin-right:0px;"onclick="openSingle('+findID+')"/>';
var paragraph = '<p id="Manual-para" class="colorMe"><a href="';
var redirect = linkMe + '#' + findID;
var manName = section.childNodes( x ).getAttribute( "manualName" );
var workPack = section.childNodes( x ).getAttribute( "workPacket" );
document.getElementById( "annotateBody" ).innerHTML += iconImage + paragraph + redirect + '">' + annotationTitle + ' - ' + manName + ' - ' + workPack + '</a></p>';
.createElement(). Also please don't use inline JS in your HTML.