This small example already gives you a functional browser, that lets you browse
the web (you'll need the kio_http executable from KDE though to access
non local files). Just try testkhtml http://www.kde.org and you will
get a widget showing KDE's home page.

KHTML has a lot of functionality. Almost everything you'll ever need
can be accessed through the member functions of the class KHTMLWidget.

Document Object Model (DOM)

The DOM is an implementation using internal classes to hold the document's data.
The classes accessing the DOM are using a refcounting scheme to hold the data.
Thus the DOM does the memory management for you. You can just use the classes
defined in the DOM header files to access parts of the document. As long as you
don't use pointers, you will not get memory leaks.

You can easily access the document being shown by the
KHTMLWidget::document() method, from where you can
get access to every part of the document.

Java

Thanks to the work of Richard Moore, KHTML can display Java applets.
Java is not enabled by default, but you can do so by using
KHTMLWidget::setEnableJava(true);, and setting the environment variable
CLASSPATH to:

CLASSPATH=$KDEDIR/share/apps/kjava/kjava-classes.zip:$JDK_DIR/lib

You will need to have the java developers kit installed though. I tested it
with JDK-1.1.7, and don't know if it'll run with other versions of JDK or with
Kaffe.

JavaScript (ECMA-Script)

The JavaScript support aims at compliance with the ECMAScript Language
specification ECMA-262 3rd edition.
This roughly equals JavaScript 1.5.