Skip to content

Instantly share code, notes, and snippets.

@yzen
Created May 6, 2015 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yzen/90a6511b4dce74bcc87e to your computer and use it in GitHub Desktop.
Save yzen/90a6511b4dce74bcc87e to your computer and use it in GitHub Desktop.
var textPosition = new AccPos(domTextArea.accesibleElement, 'at');
// Read word by word
var word1 = textPosition.move('forward', 'word');
var word2 = word.move('forward', 'word');
var text = word2.textInBetween(word1);
var text = word1.findText('forward', 'paragraph');
while(word) {
console.log(word.anchor.value);
word = word.move('forward', 'word');
}
function search(acc) {
switch(acc.role) {
default:
return 'beforeend';
break;
}
}
var pos = new AccPos(document.accEl, 'afterbegin')
console.log(pos.anchor); // document.accEl
function moveForward(pos) {
return pos.move('forward', search);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment