Javascript code : I am try to fetch a javascript code as it use for  converting input decimal to manipulate the data to be  binary  then count the number of 1's ,The below code is running be no output found nor  errors.


    Javascript Code:


    function demo()
    {
    var arra, i, rem ;
    var Input =document.getElementById('demo');
    arra = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
    var x = 1;
    while(Input > 0)
    {
         rem = Input%2;
        Input = (parseInt(Input/ 2));
    if (rem > 0)
    {
            arra[i] = 1;
           i = i +1;
    }
    else
    {
            i = i +1;
    }
    }
    
    
    
    
    while ( x < 35 )
    {
    	if(arra[x]  == 1)
    	{
    	    document.getElementById("output").innerHTML=  "SOB Found";
    		x = x +1 ;
    		}
    	else
    	{
    			x = x +1 ;
    			}
    	
    
    }
    }
Html Code:

    <!doctype html>
    <html>
      <head>
        <title>Test Phase</title>
     
    	<script src="SOB.js" type="text/javascript"></script>
      </head>
      <body>
     
    
    <input type="text" name="value" id="Input"   />
    <input type="submit"  value="submit"   onClick="demo()"  />
    <p id="output"> </p>
    
    
       
    <script src="SOB.js" type="text/javascript"></script>
    
     </body>
    </html>




 