Bit of an immature request

How do I implement 4chan-esque spoiler tags and greentext?

Example of spoiler tags
Before mouse-over:

After mouse-over:

My screenshot utility doesn't show it but you have to keep the mouse over it to keep the text revealed.

Also, for those who don't know what greentext is, all it is is when you have a greater than symbol in front of a phrase (>) The text will turn green until the next line

>This is greentext
This is normal

I was able to accomplish the spoilers in MyBB by using the MyCode utility.

The code to use it was
text here
And it was implemented with this:

<span style='color:#000000; background:#000000' onmouseover="style.color='#ffffff'" onmouseout="style.color='#000000'">$1</span>
The greentext was accomplished like this:

Replaced by this:

$1<span style="color: #32CD32;">&gt;$2</span>$3
The issue with the greentext code was that every other line would revert to normal colour text.




Anyone know why that is?

Thanks for the help.