javascript, simulate keyboard events, work on chrome(webkit)
问题 in FF, i've used this code: if (keyCount == lineLimit) { // method in FF, no Chrome var mock = document.createEvent("KeyboardEvent"); // or KeysEvent mock.initKeyEvent("keypress",true,true,null,false,false,false,false,14,0); var x = document.getElementById('InputCategory'); // rise height before Enter $(this).height(div_height + font_height + offset_height); // mock Enter x.dispatchEvent(mock); // init keyCount keyCount = 0; } it works, but could not be effective on webkit-based browsers like