It is easy with EJS, there is a text string element (you just provide text and coordinate).
However,you are writing your own code. So you need to draw a rectangle box and print a string at the same position.
You can make it as an "onmouse over" action to display those information.