Setting the innerHTML property is a bit too basic for this purpose. You'll have to use the HTML DOM. There's a tutorial on w3schools:
http://www.w3schools.com/dom/default.asp You can write a simple bubble-sort algorithm that manipulates the DOM tree directly, so that you don't even have to load the values into an array first. It's not beginner stuff, but I wouldn't exactly call it advanced material either. Shouldn't take you more than a day.
SCJP 1.4, SCJD 1.4, SCWCD 1.3, ICSD:Websphere 5.1