I think you want to clear the textfields. You just need to empty the textFields upon successful login. For this you just need to modify your code as follows
button.addEventListener('click', function(){
Cloud.Users.login({
login: userNameField.value,
password: passwordField.value
}, function (e) {
if (e.success) {
var user = e.users[0];
//Clears the TiUITextField's values
userNameField.value = "";
passwordField.value = "";
alert('success');
} else {
alert('Unable to log you in:' + e.message);
}
});
});
This will do the trick :)