How to get Google Map keyboard accessible by Javascript without click operation

Google Map V3 is not able to access the keyboard functionally until the map has been clicked.

This article shows how to get focus to Google Map element by Javascript/jQuery.

Wrong operation

Assume that #map is map container.

These codes are not works.

$("#map").focus()

or

$("#map").click()

because you have to emulate more deeper element in the map container.

Focus to Google Map element

Right way is below.

$("#map")[0].children[0].children[0].children[0].focus()

This enable the keyboard access like allow key scrolling or plus/minus key zoom.

Popular Articles from This Page

Top Page

Economizing Technology > How to get Google Map keyboard accessible by Javascript without click operation