Reputation: 0 Apprentice
- Active Posts:
- 29 (0.04 per day)
- 26-March 13
- Profile Views:
- Last Active:
- Feb 16 2014 08:53 PM
- Dream Kudos:
Posts I've Made
Posted 22 Sep 2013in order for bubblesort.innerHTML = s; to work you would have to set the variable bubblesort to the element using getElementById("bubblesort"). With out doing this there is no reference to the element with the id of bubblesort.
bubbleSort is the name of the method. bubblesort is the name of the div. I still have to use getElementbyid on it or i am just misunderstanding you?
Posted 22 Sep 2013I did the global variable with array1. I dont understand what you mean about the bubblesort though?
Posted 22 Sep 2013Taking a closer look it is the scope of your bubbleSort(array1);. array1 is not excessable outside the onloadHandler() function.
And where does bubblesort come from in this line? bubblesort.innerHTML
Ahhh, so how would I go about accessing the values from array1 if it is not within that scope? And the bubblesort.innerHTML sets the div labeled bubblesort = the value s. S is the value of the output of the sorted array in the bubblesort function.
Posted 22 Sep 2013Its working for me. I added 10 numbers [1,2,3,4,5,6,7,8,9,1] to the prompt and got this in return. were you expecting something different.
The table works great when printing the users input(which is the variable array1). The problem I am having is printing the bubblesort out under the table( in the div = bubblesort) to display the sorted numbers.
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
- Click here to e-mail me
Ghandi_Of_Codez hasn't added any friends yet.