Set autofocus on Datatable - $.focus() not making changes
Set autofocus on Datatable - $.focus() not making changes
Hey Guys,
I would like to set the autofocus to the first select input at the table. However, cause the select input gets created by DataTables I have to call the jQuery function after the select input and the table got rendered by DataTables. I am trying to to this with $("#autofocus_on_load > select").focus()
. But it isn't making any changes or at least focusing the select input..
How can that be? - You guys have any solutions for this?
Here you can find a demo of my table:
https://jsbin.com/yebutafawe/edit?html,js,output
Kind regards and Thank You!
This question has an accepted answers - jump to answer
Answers
Setting focus on the first select box is not going to gain you anything. The user still has to click on the select box to cause it to drop down.
however, I made this change...