You can do this with the console in firebug for firefox. I do it frequently. Just go to any page that has the jQuery library referenced, and write your heart out!
The great thing about this is that you're not limited to a single sample-page. Every jQuery-enabled website online becomes your playground when you've got firebug's console.
And before FireBug gives you the ability to modify the souce of a page, you can paste in any additional HTML you wish onto any page, and then write more jQuery against your newly-pasted HTML.
Apparently there's an extension called FireQuery for firebug to facilitate this very thing.