title: How to display the sorted array
body: <p>I'm trying to display the sorted array using javascript DOM but it is only displaying the entered array.what did i do wrong?</p>
  
  <p>for eg for array 
  Arr[7,8,2,3,5,4]
  when i ran the js file seperate without Dom it displayed [2,3,4,5,7,8] but when using DOM [7,8,2,3,5,4]</p>
  
  <pre><code>function BubbleSort(Arr){
      var temp;
      var Arr=document.getElementById("data1").value; 
      for(let i=0;i&lt;Arr.length-1;i++){
          for(let j=0;j&lt;Arr.length-i-1;j++){
              if(Arr[j] &gt; Arr[j+1]){
                  temp = Arr[j];
                  Arr[j] = Arr[j+1];
                  Arr[j+1] = temp;
              }
          }
      }
      console.log(Arr);
      document.getElementById("demo").innerHTML="the answer is :" +Arr;
  };
  </code></pre>