I'm trying to resolve this course but as a beginner in JavaScript, it's a little hard. this course is about sorting an array of numbers (sorry for my bad english it's not my first language )
i used the method .sort() cause the numbers are in an array but it keep telling me that it's not a fonction..
numbers = document.getElementById("numbers").value;
(function() { document.getElementById("run").addEventListener("click", function() {
numbers.sort()
alert(numbers);
});
})();
<div class="field">
<label for="numbers">Numbers:</label>
<input type="text" name="numbers" id="numbers" readonly value="2, 4, 14, 10, 90, 23, 16" />
</div>
<div class="actions">
<button type="button" id="run">Run</button>
</div>
when i run my code it says that numbers.sort() is not a fonction but how can i use this method ?? Thanks you in advance !