The other answer is incomplete. UpdateQueryAsync was missing which does the actual write opration on the server. Below is complete piece of code.
function UpdateItem() {
clientContext = new SP.ClientContext.get_current();
oList = clientContext.get_web().get_lists().getByTitle(‘ListName’);
this.oListItem =oList.getItemById(1);
oListItem.set_item(‘Title’, ‘My Updated New Title’);
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQueryInsertSucceeded),
Function.createDelegate(this, this.onQueryInsertFailed));
}
function onQueryInsertSucceeded() {
alert(‘Item Updated: ‘);
}
function onQueryInsertFailed() {
alert(“Item Update Failed”);
}

