in google chrome innerText seems to return the text of the element that the user see
which is exactly what i need.
so i need a shim of innerText for Firefox.
for example:
<div id='1'><br> f<div style='display:none'>no</div>oo bar</div>
<script>
function test(){ return document.getElementById('1').innerText }
</script>
the function test would return "\n foo bar"
ultimate goal is to make a text editable area where links are clickable and where tags are highlighted and where the linking and highlighting is created on the fly while typing.
my approach here is:
on every keyup:
- save the cursor position
- cut the text with innerText
- parse the links and tags of the text returned by innerText
- paste the parsed text into the editable area
- restore the cursor position
any idea for a firefox innerText shim?
thanks!