Answer to Question #15262 in AJAX | JavaScript | HTML | PHP for Cherry jurada

Question #15262
can u make a program that will ask for 12 numbers and display an option.It will display the entered number from high to low or low to high based on option.
1
Expert's answer
2012-11-08T09:06:52-0500
Click the button to sort the array.
1-9 sort9-1 sortfunctionmyFunction()
{
var points= [40,100,1,5,25,10];
points.sort(function(a,b){returna-b});
varx=document.getElementById("Sorts");
x.innerHTML=points;
}
functionmyFunction2()
{
var points= [40,100,1,5,25,10];
points.sort(function(a,b){returnb-a});
var x=document.getElementById("Sorts");
x.innerHTML=points;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS