What exact behavior(s) of $ are you trying to replicate. It does a lot:
$('#anid') //returns a DOM element reference if found
$('.aClass') //returns either one or more DOM element references
$('<a href="http://a.link.com">A Link</a>') // generates a DOM element and returns it
$(document) //passes a DOM reference into jQuery to be acted on
var a = document.getElementById('anid');
$(a) //passing in a DOM element reference for jQuery to act on.
So as you can see, $() does a lot. What exactly are you trying to achieve? Additionally, is this only for the iPhone or is the project you're working on expected to work on non-webkit browsers too?