Quote:
I have a problem with DOM.
If I have the xy coordinates in a web page, how can I get (possibly
using Javascript) the corresponding word placed into the web page at
the given coordinates? |
The DOM is the Document Object Model which describes the *structure* of
the document and contains no information about how it is displayed.
The rendering of the document is controlled by the User Agent (generally
a web browser, but could be a screen reader or some other UA). This
renders the document according to its own internal rules and, where
appropriate, according to the associated CSS style-sheets.
If you need to place a word at a specific location, one method would be
to put it in a DIV and then set its style property such that its
positioning is absolute and set its top and left properties accordingly.
Just a word of warning: accessibility is a hot button on this forum.
This kind of functionality is not going to come across on screen readers
and text only browsers and some people take issue with this. Ultimately,
the judgment call is yours, but I would strongly recommend that you look
into the impact of this Javascript on the page's accessibility and make
an informed decision as to whether this is an issue for you.