With the iOS 4.2 update for iPhone and iPad a new and really cool feature was spotted.. Support for accelerometer in Safari through HTML5.
SlashGear writes that Apple has opened up accelerometer and gyroscope access to mobile Safari web developers in iOS 4.2, meaning iPhone, iPod touch and iPad sites can potentially be controlled by those motion sensors. Developer Maximiliano Firtman spotted the update, which appears to be based on the W3C draft for the DeviceOrientation API.
You can try it out by visiting http://www.mobilexweb.com/samples/ball.html with your iPhone or iPad running iOS 4.2.