I have a script that assigns tabindex to visible elements on a page. Most of those are form elements but I also needed to add a way to add a div that I use to show/hide a section.
<span class="tabInto">Show/Hide</span>
I do this with jQuery
$(':input:visible, .tabInto').each(function (i) {
$(this).attr('tabindex', i + 1);
});
So, when I tab through the form fields I am able to tab into that span as well. Now I need to be able to simulate click action, to expand hidden section, by using keyboard when I am focused on that span. How Can I do that? Is it usually done with Enter or Space bar?..
$("filter element").click();.