The code sample below is from Apple's documentation, I know it works on iPhone and Safari, and probably WebKit. You can get the insert id from the resultSet response object by using resultSet.insertId
Also, you can get the number of affected rows, for an update query for example by using the rowsAffected property of the resultSet object.
db.transaction(
function (transaction) {
transaction.executeSql('INSERT into tbl_a (name) VALUES ( ? );',
[ document.getElementById('nameElt').innerHTML ],
function (transaction, resultSet) {
if (!resultSet.rowsAffected) {
// Previous insert failed. Bail.
alert('No rows affected!');
return false;
}
alert('insert ID was '+resultSet.insertId);
transaction.executeSql('INSERT into tbl_b (name_id, color) VALUES (?, ?);',
[ resultSet.insertId,
document.getElementById('colorElt').innerHTML ],
nullDataHandler, errorHandler);
}, errorHandler);
}, transactionErrorCallback, proveIt);
Apple's HTML5 Database Documentation