This is from the Spittle Bug, or Frog Hoppers as they are sometimes called. This white slime is also called Cuckoo Spit (UK) and Frog Spit (USA).
You can just see a small green shadow in the centre of this picture, which is the nymph.
The immature nymphs secrete a frothy mass and substance that resembles spittle and this acts as protection while they are feeding - by sucking juices from plants. If you look closely at the “spittle” you can see the tiny nymphs, but not always as the adult insect leaves the mass of ‘spittle’ and moves away. Just in case you wanted to know….the ‘spittle’ comes from a fluid voided from the anus and from a mucilaginous substance excreted by epidermal glands. Ergh. Here an adult Spittlebug on the right. Cosmoscarta bispecularis.
So why do it? Well, it protects them from predation, and also keeps them nice and cool and moist. The Adult bug is quite cool too, as it can still jump as well as fly. To compare, it would be like me jumping around 500ft straight up. (I might win a few medals, but I would be worried about the landings!). Also, I can probably withstand 5gs (G-Force) before passing out, but this little chap can handle up to 400gs!
Even though spittlebugs feed by extracting plant sap/juice through needle-like mouth parts, they seldom cause notable injury to the plant. But, as always there are some exceptions - but these can easily be washed off plants.
Photos of Spittlebug taken at Permaclub Farm in ClearWater Bay.