lastVowel.js

/*reference:http://stackoverflow.com/questions/22951996/after-last-vowel-character-want-to-attach-xy*/

by guest271314

HTML

<input type="text" value="" /><br />
<div id="name"></div>

JavaScript

$(function () {
    $("input").on("change", function(e) {       
    $("#name")
        .html(function (index, o) {
        var v = /[aeiou]+.$/gi;
        var o = $(e.target).val();
        var n = v.test(o);
        return (n ? String(o.replace(/[^aeiouy]$/gi, "") + "xy").toUpperCase() : o)
    });
   });
})