(I'm punting on browser-dependent issues by assuming that JQuery will make them go away for any modern browser. As a pragmatic matter I just don't have the time and expertise to do better than this for what are relatively unimportant website augmentations.)
(Among other advantages of the first approach is that it lets you design and lay out the final HTML in one place.)
file that the HTML pulls in with appropriate
onchangeattributes; instead attach them on the fly when JQuery runs your code after page load finishes. Find the HTML elements to attach to through either
class, or other selectable attributes.
Sidebar: an example of what I mean by (pure) augmentation