f = $('<form>');
f = $('<form />');
and everything started working. I was using the (admittedly invalid) lone opening tags without a thought after seeing that form in several jQuery tutorials and, not being that familiar with jQuery, thinking it was a supported syntax.
So, always use valid markup everywhere and avoid this kid of bug.