code: public Object eval(String javascriptFunction) {
          if (!element.is().present()) {
              return null;
          }
          try {
              WebElement webElement = element.getWebElement();
              JavascriptExecutor js = (JavascriptExecutor) driver;
              return js.executeScript(javascriptFunction, webElement);
          } catch (NoSuchMethodError | Exception e) {
              log.warn(e);
              return null;
          }
      }
docs: Executes a provided script on the element, and returns the output of that
  script. If the element doesn't exist, or there is an error executing this
  script, a null value will be returned.
  
  @param javascriptFunction - the javascript function that is going to be executed
  @return Object: any resultant output from the javascript command