Quantcast
Channel: put cursor at end of text input's value - Stack Overflow
Browsing latest articles
Browse All 7 View Live

Answer by АртёмПешков for put cursor at end of text input's value

Select element by class or id, then focus, and then re-insert value.<input type="text" class="element-to-autofocus" value="Some existed text" /><script> temp_el =...

View Article



Answer by Obaidul Haque for put cursor at end of text input's value

Use this, its nice work for me...<input type="text" name="txt" value="value text" autofocus="" onfocus="this.setSelectionRange(this.value.length,this.value.length);">OR add this line to your...

View Article

Answer by user4723924 for put cursor at end of text input's value

You can add this parameter to your text input field:onmouseover="this.setSelectionRange(this.value.length,this.value.length);"onfocus="this.setSelectionRange(this.value.length,this.value.length);"NB:...

View Article

Answer by J_z for put cursor at end of text input's value

Upgrade to @harsha's answerI found that to make solution work with Firefox,we need temporary reset value to "not-equal of value", then set it back<input type="text" autofocus value="value text"...

View Article

Answer by Ishan Jain for put cursor at end of text input's value

Use Jquery for this:$(function() { var input = $("#txt1"); var len = input.val().length; input[0].focus(); input[0].setSelectionRange(len, len); });<script...

View Article


Answer by Harsha Venkataramu for put cursor at end of text input's value

This works for me<input type="text" autofocus value="value text" onfocus="this.value = this.value;"/>

View Article

put cursor at end of text input's value

So, currently I have a text-input-field with a value that is also autofocused.On page load, the value is selected / highlighted. Is there a way I can put the cursor at the end of the value text instead...

View Article
Browsing latest articles
Browse All 7 View Live




Latest Images