def is_focused_on_element(browser, selector):
 return browser.execute_script("return $('{}').is(':focus')".format(selector))

def is_focused_on_element ( browser , selector ) : return browser . execute_script ( "return $('{}').is(':focus')" . format ( selector ) )
check if the focus is on the element that matches the selector .