I am creating an extension in Firefox whereby the user can highlight several texts on a web page. A button should appear just above the beginning of the highlighted text which when clicked will display an input textbox where the user can add comments.This textbox then can be closed whilst retaining the information.

Basically, I need some info on how to create a button on top of the selected text and when clicked display an input text box.