<input type="text" data-bind="selectOnFocus: true">
Selects all text when the element is focused.
<input type="text" data-bind="selectOnFocus: /^[^\.]+/">
Selects all text before the first period when the element is focused.
<input type="text" data-bind="selectOnFocus: { pattern: /^[^\.]+/, onlySelectOnFirstFocus: true }">
Only select the pattern on the first focus.