I am using label for attribute for input elements in my website that will help blind users.
Currently when user click on label, the corresponding input is getting activated. That means if there is textbox for name, then cursor will go in the start of textbox.
For example, if name in textbox is "John", then on click label, cursor will enter in textbox and will show before "John".
But what I want is that it should select "John". That means text of textbox should be selected.
Can anyone help me how I can implement this?
My code is shown below:
<div class="editor-label"> <label for="ContactName">*Name</label> </div> <div class="editor-field"> <div> <input id="ContactName" maxLength="40" name="ContactName" type="text" value="John" /> </div> </div>