I have a web application with no images in it. It is for visually impaired people. It is navigated using TAB button. How can I get the title/text of the selected web page like button,menu,etc. By selected I mean using TAB button, not mouse click. Using Javascript or any other language.
Asked
Active
Viewed 61 times
1
-
you can refer here https://stackoverflow.com/questions/18316395/javascript-for-handling-tab-key-press it almost answers you question – Dinesh undefined Jun 07 '17 at 12:43
-
I want a 'TAB-over' effect, similar to 'mouse-over' effect or hover effect in CSS. Thank you – Prajwal Jun 07 '17 at 12:50
1 Answers
0
Use .focusin()
method of jQuery library. Try to navigate on the form inputs from the snippet below using TAB button.
$(document).focusin(function(e) {
console.log(e.target.name);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form action="#">
<input type="text" name="input1"/>
<input type="text" name="input2"/>
<input type="text" name="input3"/>
</form>
I used name property of the event target in my example, but you could get any property value. For example
$(document).focusin(function(e) {
console.log($(e.target).attr("type"));
});
It is possible to get id
and another info by same way.

Alexander
- 4,420
- 7
- 27
- 42