Explore the community Forums General Topics Instructional Design SkipNav Construction Reply To: SkipNav Construction

#373296 Score: 0
Profile photo of Jason Dalrymple
Jason Dalrymple
Member
beginner
intermediate
profile
wise owl
curious george
contributor
friend finder
advanced
picture perfect
54 pts
@JasonADal

A quick correction for the button JavaScript action. You need to have “btn” in the HTMLNAME area:

document.getElementById(“%HTMLNAME%btn”).focus();

Without “btn”, you’re targeting the div ID, not the button ID. It’s the same concept as hiding an image from tab order, as you have to target the “<a” name of the element. I also prefer to use onShow as an action on the element for two reasons:

  • It prevents the RunJS from running “too early”; I’ve had experiences where the JS is “run” before the element is rendered.
  • You can attach the action to ANY button without having to edit the name in the JS (see below). This allows me to create a library object that I add to any element, based on it’s type.

If I’m reading Bill’s CSS correctly, I wonder if it may be better to use a custom div and class rather than targeting the specific element in the CSS? I’m not totally CSS saavy to know with confidence what that would look like from a coding perspective, but maybe “#customdivname .classname” etc.? I would need help with that potential method.