/    Sign up×
Community /Pin to ProfileBookmark

set focus on a <tr>

Hi
I am trying to write a script that enables users to move alongside rows within a table using controll – arrows (key down/key up) and highlight each row as it moves. I have a javascript function that captures the ‘onkeydown’ event on the row and highlights the next row But the focus doesn’ t seem to move to the next row -when I click on the ‘key down’.
Does anyone know how I can set the focus on the row?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonJan 20.2004 — As far as I know, you cannot set focus to a table row. You can set focus to form fields and pop-up windows but not table rows.

<covering my arse>

I said, "as far as I know", because I have learnt that when I say "you can't" pyro undoubtedly comes along and proves otherwise. In this case I'm 99.99% sure that you can't though.

</covering my arse>
Copy linkTweet thisAlerts:
@pelegk1Jan 20.2004 — a focus but it can be complicated

by changes the css of eachcell

try to look at

www.javascript.com
×

Success!

Help @nhearne 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.15,
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,
)...