STYLE SWITCHER

Add Options from array in Select using jQuery

<script>
var array = [
{ name: 'John', skills: 'html, css' },
{ name: 'Smith', skills: 'jquery, css' },
{ name: 'Jenny', skills: 'js, angular.js' }
];
var option = '';
for(var i = 0; i < array.length; i++){
option += '<option value="' + array[i].name + '">' + array[i].skills + '</option>';
}
$("#selectList").append(option);
</script>

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Keep your skills sharp, get informed.

    Subscribe to our mailing list and get interesting stuff and updates to your email inbox