There is no way for JavaScript in a web page to interact with elements defined inside a Firefox extension.
Elements defined inside the Firefox extensions are part of the browser user interface (chrome). Since web pages run JavaScript with restricted privileges they cannot do a lot of things and among them, they cannot reference or interact directly with the chrome elements.
JavaScript code running in the extension can access elements defined in the web pages because it has high privilege. So if you want both to interact, it must be initiated by the extension code.
And even when doing so, you have to be VERY careful or your extension could open a big security hole that could allow a malicious website to execute JavaScript with chrome privileges.
The following links can give you more information on this:
https://developer.mozilla.org/en/Security_best_practices_in_extensions
https://developer.mozilla.org/en/Code_snippets/Interaction_between_privileged_and_non-privileged_pages