I need to add a '+' button to the top right corner of "myDiagramDiv"

I need to add a ‘+’ button to the top right corner of “myDiagramDiv”.
I want to show and hide the ‘myPaletteDiv’ on the click of ‘+’. I have used z-index but its not working.

Do you expect that button to scale along with the diagram? Probably not, so I suggest that you implement that button in HTML and position it in front of the “myDiagramDiv” HTMLDivElement.