text editor with jquery

text editor with jquery

hi every on , im creating a text editor , my problem is :
how can i , for example ,  when select 3 text node that each one have parent : p tag , and click bold button , each text node wrapping by <strong> tag and replace with current text node that already have p tag as parent ,
sorry for my bad english !!