title: javascript Bubble sort problems (probably very easy)
body: <pre><code> &lt;html&gt;
   &lt;script&gt;
   var tal;
   var array = [];
   var element=parseIFloat(); 
  
  
   function bubbleSort(A){ 
    var swapped,
        len = A.length; 
  
    if(len === 1) return;
  
    do {
      swapped = false;
      for(var i=1;i&lt;len;i++) {
        if(A[i-1] &gt; A[i]) {
          var b = A[i];
          A[i] = A[i-1];
          A[i-1] = b;
          swapped = true;
        }
      }
    }
    while(swapped)
  }
  
  
  function insertnumber(){
  var element=document.getElementById("element").value;  
  insert (element,array);
  }
  
  function insert(element, array) {
    array.push(element);
    alert(array);
    bubbleSort(array);  
    alert(array);
  }
  
  
  
  &lt;/script&gt;
  &lt;body&gt;
  &lt;input type="button" value="Mata in" onclick="insertnumber()" id="resultat"&gt;
  tal&lt;input type="number" id="element" autofocus&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This my code but i really dont know how to get it working again, my problem is that i cant get it to read numbers correctly, trying to use "var element=parseIFloat(); " but that doesnt seem to work.. </p>
  
  <p>Thanks :)</p>