Hello all,
I use the MooTools Javascript library. And this library give a couple of really useful functions here: http://mootools.net/docs/more/Element/Element.Forms
The problem is that this functions only work for 'form' elements like textarea, etc.
Now i am making a online editor and for the editor it self i use a div element and the content editable functionality.
When i want to use functions like getCaretPosition in the mootools (more) library this line gets called:
var range = this.getDocument().selection.createRange();
But than i get this error:
this.getDocument().selection is undefined
It seems that only form elements have this selection object (on this document :S ?).
Is there a way to add the form functionality to the div (or all) element(s) ?