Unable to write over selected text on a input

by dcardoso

HTML

<div id="current1">Click Me!</div> <br />
<input id="current2" type="text" value="2" maxlength="1" />

JavaScript

$( '#current1' ).click( function(e) {
    $( '#current2' ).focus().setSelectionRange( 0, 1 );
});