2010-12-06 7 views

Répondre

0

Jetez un coup d'œil au A-Tools plugin pour jQuery.

Utilisation de base semble être:

var cSelection = $("#myInput").getSelection(); 

/* might give, (start and end would be equal for normal caret operation) */ 
cSelection = { 'start': 0, 'end': 3, 'text': '123', 'length': 3 }; 

/* move caret to one place after end of selection */ 
$('#myInput').setCaretPos(cSelection.end + 1); 
Questions connexes