Add multiple items to text-area with duplicate items
<p>Add multiple items to text-area with duplicate items.</p>

<p>I have one text-area which store data after clicked add data link.</p>

<p>How can i prevent add duplicate items to text-area?</p>

<p>JavaScript call DOM event: </p>

<pre><code>  var Dom = {
    get: function(el) {
      if (typeof el === 'string') {
        return document.getElementById(el);
      } else {
        return el;
      }
    },
    add: function(el, dest) {
      var el = this.get(el);
      var dest = this.get(dest);
      dest.appendChild(el);
    },
    remove: function(el) {
      var el = this.get(el);
      el.parentNode.removeChild(el);
    }
  };

  var Event = {
    add: function() {
      if (window.addEventListener) {
        return function(el, type, fn) {
          Dom.get(el).addEventListener(type, fn, false);
        };
      } else if (window.attachEvent) {
        return function(el, type, fn) {
          var f = function() {
            fn.call(Dom.get(el), window.event);
          };
          Dom.get(el).attachEvent('on' + type, f);
        };
      }
    }()
  };
</code></pre>

<p>JQuery add data to textarea:</p>

<pre><code>    $("#lkaddlanguage").click(function(){


                 var totalstring;
                 var checkconstring = $("#contentlng").text();

                 var strLen = checkconstring.length;
                 myStr = checkconstring.slice(0,strLen-1);
                 //alert(myStr);

                 var checkedItemsArray = myStr.split(";");
                 var j = 0;
                 var checkdup=0;

                totalstring=escape($("#textval").val()) ;

                var i = 0;

                var el = document.createElement('b');
                el.innerHTML = totalstring +";";

                Dom.add(el, 'txtdisplayval');

                Event.add(el, 'click', function(e) {
                  Dom.remove(this);
                });

    });
</code></pre>

<p>HTML Display data</p>

<pre><code>&lt;input type="textbox" id="textval"&gt;
&lt;a href="#lnk" id="lkaddlanguage" &gt;Add Data&lt;/a&gt;
&lt;textarea readonly id="txtdisplayval" &gt;&lt;/textarea&gt;
</code></pre>
