0

Hello can I ask some help on this, I'm trying to alert the value of the selected item for select, but it does not alert(), I've search for answers and it seems that my code is the same with the answers given, here is the sample of my code

Code.js

<script>
        $("#sort").change(function(){
            alert('Selected value: ' + $(this).val());
        });

</script>

index.html

<select id="sort">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
</select>

I can't seem to see the error on my code.

Deo
  • 499
  • 1
  • 5
  • 15

0 Answers0