You better check the element in your browser and see if there is an element with id "x_roleEmailType" (case-sensitive). If yes, check what the element is, if it is a "selection-list", then you better use vanilla JavaScript, e.g.
document.getElementById("x_roleEmailType").addEventListener('change', () => {
// Your code
});