Hi, hope someone can help with this. I know a little JS, but not all that much.

I use a Javascript HTML Editor for my blog and it works a treat, except for one aspect.

I can select text in a textarea, but if tags are present a problem occurs.

I can select these fine
Code:
before<br><br>After
before
After
But if I select anything with tags this happens
Code:
<br><
><br>
Is there a very simple bit of code which will overcome this for the entire textarea?

At the top of the code is a variable, used throughout the code with conditions. I assume this "enables" the textarea.
Code:
var textarea;
Perhaps it needs something?

I tried:
Code:
var textarea(focus);
But that didn't work.