by Turing_Machine · 14y ago · 0 comments
$iframeEditor.keydown(function(event) { if (event.which == 9) { event.preventDefault(); iframeDoc.execCommand('insertHTML',true,' '); }});
I agree, not that hard to solve (obviously your mileage may vary as to whether you might want to insert spaces (as shown), the number of spaces, just ignore it, do something else, whatever). You might also need to add a little bit of extra event-handling code to make it work in IE -- I don't know. Fortunately I only needed to support WebKit for this project. :-)