I\'m trying to accommodate users without JavaScript. (By the way, is it worth the effort nowadays?)
In one HTML file I\'d like part of it execute if scripts are on
By the way, is it worth the effort nowadays?
Yes, it's worth worrying about accessibility. You should use progressive enhancement where possible, i.e. make a basic version that works without scripting and then add the scripting functionality on top of it.
A simple example would be a pop-up link. You could make one like this:
link
However, this link wouldn't work if someone, say, middle-clicked or tried to bookmark it, or had scripts disabled etc. Instead, you could do the same thing like this:
link
It's still not perfect, because you should separate the behavior and structure layers and avoid inline event handlers, but it's better, because it's more accessible and doesn't require scripting.