Partial port of jQuery to Java