M'm new to javascript.pls help to make a Simple WYSIWYG editor only i want <br> tags. not a complicated editor.
Why do you need to write your own? There are many js html editors on the net. For example I use simple widgEditor in some cases.
Also try the FCKeditor or TinyMCE "I think wordpress use this" , those are opensource scripts which is widely used.
If the only thing you want to replace is new line characters with <br> tags, then you don't need a WYSIWYG editor. The new lines are visible in your text area when you hit enter. Now if you want to get the same output on your page after submitting the form, use a function like nl2br() (assuming you're using PHP).