Aui-select option not showing properly in to the right place in the DOM

Hello community !

i’m trying to add options to my aui-select on the click event but the option not showing in the right place in the dom

option

code snippet :

 <aui-select id="select"   placeholder="Select a project"  >
  </aui-select>
        </div>
        <div class='buttons-container'>
            <button  class='aui-button aui-button-primary'  onclick="myFunction()">Add</button>
        </div>
<script type="text/javascript">
 function myFunction() {
 $('#select').append($('<aui-option>').val('optionValue').text('optionText'));
 }
</script>

what i m missing please ?

i appreciate your time , thank you

Hi @hamzabouallegue could you elaborated why you need to dynamically append the options?
Maybe you’re looking for the " Asynchronous (HTML)" option of aui-select?

1 Like