How can I keep the focus to my selected text when I click a button?
I have a text selection for my 开发者_Python百科editor in IE written in javascript.
checkedText = parent.frames['myframe'].document.selection.createRange();
Everything works ok just the first time. Then if I click a button the focus is gone for a while and the checkedText has the previous text as well. I tried also keep the focus with:
checkedText.select();
but it doesn't work. I know it is a but hard to explain my problem but if anyone has an idea I would appreciate it.
thanks a lot
Does the following not work? If not, maybe you can post a page showing the problem.
parent.frames['myframe'].focus();
checkedText.select();
document.getElementById("test").select();
document.getElementById("test").focus();
精彩评论