Set Focus Demo

HTML

<input type="text" id="editor" value="Some Text">
<input type="text" id="ed1" value="Some Text">


<button type="button"   value="Set Focus" onclick="setFocus();" > Click me </button>

JavaScript

function setFocus() {
    var editor = $('#editor');
    var value = editor.val();
    editor.val("");
    editor.focus();
    editor.val(value);
}