Can I declare the same value for two attributes at once
Posted
by graphicdivine
on Stack Overflow
See other posts from Stack Overflow
or by graphicdivine
Published on 2010-05-28T07:37:12Z
Indexed on
2010/05/28
7:41 UTC
Read the original article
Hit count: 179
JavaScript
|html
For example, for accessibility reasons I want my onfocus
and onmouseover
to have identical values. For the sake of maintainability I want to declare this once only.
What I'd like to be able to do is this:
<a onmouseover,onfocus="assist('hello');">linktext</a>
But, of course, that would be too easy, and doesn't work. What's the best way I can achieve this DRYing out of my tags?
© Stack Overflow or respective owner