Create BBCodeJS.js

JavaScript part of BBCode.
JavaScript functionality is:
if not text selected in textarea, BBCode tag appends to the end of text in textarea.
if there is some selected area tags append and prepend it.

Code can be used when we make an instance of our object "BBCode" and set for property the className of our textarea.
After that we use addEventListener to catch if there is a click on some button from our BBCode