如何使用asp.net将焦点集中到网格视图



在我的网页中,如果我点击一个按钮,就会生成一个网格视图。我正在使用tab键浏览网页。。。单击按钮后,焦点不会转到gridview,而是转到footer元素。。。。为什么我需要Focus for gridview是使用nvda屏幕阅读器读取其中的内容。。。问题:我应该如何将焦点转移到网格视图?

您可以使用jQuery进行

$(':text').on("focus", function(){
//here set in localStorage id of the textbox
localStorage.setItem("focusItem", this.id);
//console.log(localStorage.getItem("focusItem"));test the focus element id
});

最新更新