title: How can I Set the Input value Using Javascript not just for view but permanent value in element when I inspect element?
body: <p>As question says it all.</p>
  
  <p>And Please don't rate it as bad because I will not be able to ask any question in future if you think it is not a good question then just let me know in comments And I will try to improve. </p>
  
  <p>What I'm trying to do is when I type something in text input it I am setting its value from suggestion and adding the value in text input from suggestion you can say appending the value.</p>
  
  <p>let us suppose we have xxxx value already stored and it shows me in when I inspect element. but when I add new value in input using javascript and I inspect element it remains xxxx so it is not appending in element so I am unable to add more values after comma because it just getting the stored value xxxx when I try to append. </p>
  
  <p>Hope getting my point. 
  Thanks</p>
  
  <p>here is the code it might help you to help me. </p>
  
  <pre><code>en4.core.runonce.add(function (){
      var contentAutocomplete = new Autocompleter.Request.JSON('1_1_17', '&lt;?php echo $this-&gt;url(array('module' =&gt; 'user', 'controller' =&gt; 'edit', 'action' =&gt; 'getinterest' ), 'default', true) ?&gt;', {
          'postVar' : 'text',
          'minLength': 1,
          'selectMode': 'pick',
          'autocompleteType': 'tag',
          'className': 'seaocore-autosuggest tag-autosuggest',
          'customChoices' : true,
          'filterSubset' : true,
          'multiple' : false,
          'injectChoice': function(token){
              var choice = new Element('li', {'class': 'autocompleter-choices', 'id':token.label});
              new Element('div', {'html': this.markQueryValue(token.label),'class': 'autocompleter-choice'}).inject(choice);
              this.addChoiceEvents(choice).inject(this.choices);
              choice.store('autocompleteChoice', token);
          },
      });
  
      var test = document.getElementById('1_1_17').value;
      contentAutocomplete.addEvent('onSelection', function(input) {
          document.getElementById('1_1_17').value = test+','+input;
      });
  });
  </code></pre>
  
  <p>I am using mootools. </p>