SharePoint allows us to update the content type to the list item by specifying the content type id.
SP.ListItem.set_item('ContentTypeId','<Id of the content type>');
Please check the below snippet to update the content type to the listitem,
//This is a ContentType ID for Announcement content type
var contenttypeId = '0x01040005B1FCA568800F4FB4162C7A09742E67';
var lisTitle = "TestNewList";
var listitemId = 1;
UpdateListItem(lisTitle, listitemId, contenttypeId);
function UpdateListItem(listTitle, listitemId, contenttypeId) {
var clientContext = new SP.ClientContext();
oList = clientContext.get_web().get_lists().getByTitle(listTitle);
oListItem = oList.getItemById(listitemId);
oListItem.set_item('ContentTypeId', contenttypeId);
oListItem.update();
clientContext.load(oListItem, 'Id', 'Title', 'ContentTypeId');
clientContext.executeQueryAsync(
Function.createDelegate(this, function() {
var listsInfo = '';
listsInfo += oListItem.get_item('Title') + '\t' + oListItem.get_item('ContentTypeId');
console.log(listsInfo.toString());
}),
Function.createDelegate(this, function(sender, args) {
console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}));
}
I hope, this solves your problem. :)