/    Sign up×
Community /Pin to ProfileBookmark

Accesskey help in html page

Hi
in my htmlpage iam using the code for button like

<td>
<input class=”largeOrange” type=”button” value=”Create Event” accesskey=”C” onClick=”JavaScript:submitCreateEvent();”/>
</td>

here iam using accesskey for making use of hotkey for button.in this case iam using “c” as hotkey.but the problem is i want letter “C” in “create event” to be underlined or some othereffect in such way that end user wiol come to know that this letter is hotkey…can any body help me in this regard…pls..
thanks..

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundrySep 22.2004 — You could use a <button> element instead:

<button class="largeOrange" type="button" onclick="submitCreateEvent();" accesskey="C"><em>C</em>reate Event</button>

Use CSS to style the <em> appropriately:

button em { text-decoration: underline; font-style: normal; }

Adam
Copy linkTweet thisAlerts:
@J_KarlssonSep 22.2004 — Can one use the :first-letter pseudo-element with the BUTTON element?

button:first-letter { text-decoration: underline; }
Copy linkTweet thisAlerts:
@DaveSWSep 22.2004 — one could but one could hardly expect support for it from microsoft...
Copy linkTweet thisAlerts:
@AdamGundrySep 22.2004 — You can - there are multiple ways of doing this. In particular, since accesskeys may not always correspond with the first letter on the button, I tend to use <em> since it makes sense to emphasise the letter. However, :first-letter is a reasonable alternative.

Adam
×

Success!

Help @mahendrasr1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...