The r:element('id') function is a shortcut for the equivalent document.getElementById(#{r:clientId('id')}) code. It returns the element from the client, based on the passed server-side component identifier. If the specified component identifier is not found, null is returned instead.