select all value in side all text box in a form on click

by manoj

HTML

<input Value="sdfsdfsdf">
<input Value="8545555">
<input Value="Billa">

CSS

input {
    padding: 8px;
    font-size: 14px;
}

JavaScript

var selected = false;
$(document).on("click", "input:text", null, function (ev) {
    if (!selected) {
        $(this).select();
        selected = true;
    } else {
        selected = false;
        this.selectionStart = this.selectionEnd;
    }

    return this;
});