KML Balloons in Google Earth - starting with version 5.0 - support HTML, CSS, and almost full JavaScript. This can be a great tool for developers looking to add rich content and interactivity into their KML files.
However, it’s not always obvious how to debug that KML content. Google Earth doesn’t have a full set of tools like Chrome Developer Tools. However, it does allow you to view console output, so console.log() output, as well as errors that would normally appear in the Chrome console or Firebug will appear in the console instead. Note, Google Earth does not allow the presentation of system dialogs (namely the functions alert, confirm, and prompt).
Here’s some quick tips on how to get it to work:
Here's a screenshot from Mac OS X:
Balloon content is rendered by WebKit, and Google Earth currently supports the equivalent of Safari 4.0.4 (which is WebKit-based). If you want to know if a particular JavaScript or CSS feature is supported, one option is to search for it on http://caniuse.com/.
Give us feedback in our Product Forums.