Check the simplespy it will give you example code for any element you spy on.