Did you try searching for some papers first? There is plenty of information on the web regarding grass/foliage animation and real-time rendering. Most popular ones are probably 2 articles from GPU Gems:
+1 for using vertex colors painting method as it gives you most flexibility and is especially good for more complex models (some bushes, trees, weeds and other). But for simple quad based grass you dont have to even paint vertices - as described in mentioned papers (GPUGems Ch07), you need to know upper vertices of a quad to animate them (lower ones touching the ground stay static), and there is very easy method to do this - you use texcoords for it. With default texcoord approach, top vertices have UV's of (0, 1) and (1, 1) so you have to check if texcoord.t >= 0.9 for example. It will be truth for two upper vertices which you can then animate. There is probably a way to optimise this branch somehow, so its for your consideration only. Just wanted to point that for quads its much easier than vertex colors and don't require you to store additional vertex attribute.
While GPU Gems can be of help often they lack some of the guidance needed to actually get it working. Some people who frequent this section have been rather helpful with our grass project and instead of nesting it in another grass thread I figured it deserved its own topic. The coloring vertex was the suggestion of Telanor ( but I doubted it since there seemed to be a better way ). I was wrong again and he was right!
We are using a complex mesh so some of the more basic functions do not work. We had implemented one previous when it was just a flat quad.. and it caused our current model to look like seaweed. Thank you for the links though and for the confirmation as to how we could do it.