Converting jQuery functions to regular functions.