What the for loop does here could be replaced by a simple css query. (i.e. `querySelector('input[name="keyboard.layouts.' + langKeyboard + '"]')` ) If nothing found by this query, use `keyboard.layouts.english` to query again. Once the input node is found, you can then pin the new keyboardNode to the top and hide the existing one, which also avoid some code dups.