javascript - how to move the text in input using js -


i use js set text input's value. when text longer input can hold, excess text hidden in right part of input. how can hide excess text in left area normal typing? forgive poor english.

when perform caret position @ beginning of text. need move caret position end.

function setcursor(node,pos){     var node = (typeof node == "string" || node instanceof string) ? document.getelementbyid(node) : node;      if (!node) {         return false;     } else if (node.createtextrange) {         var textrange = node.createtextrange();         textrange.collapse(true);         textrange.moveend(pos);         textrange.movestart(pos);         textrange.select();         return true;     } else if (node.setselectionrange) {         node.setselectionrange(pos,pos);         return true;     }     return false; }  setcursor(input, input.value.length); // input textbox 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -