Edit in JSFiddle

$(function () {
    $('input.target1').focus(function () { // select text on focus
        $(this).select();
    });
    $('input.target1').mouseup(function (e) { // fix for chrome and safari
        e.preventDefault();
    });
    $('input.target2').select(function () {
        $('.log').append(' Handler for .select() called. ');
    });
});
<form class="well">
    <p>
        <input type="text" class="form-control target1" value="click or focus this input to select text in it">
    </p>
    <p>
        <input type="text" class="form-control target2" value="try to select text in this input">
    </p>
    <div class="log"></div>
</form>

External resources loaded into this fiddle: