0

I have a dropdown(Dataspy) , with a single options ,which is coming from the cloud environment, now i want to add an option to my DataSpy dropdown dynamically(since i donot have permissions to access the cloud DB), and below is the image i have attached , i receive during debugging in Chrome , which has values, coming from cloud (in below case value is 100116), how can i create one of that kind using jquery? i donot have any idea . Help me with this.
enter image description here

below is the code where i want to add a new option(WorkRequest) dynamically.

function DropdownChange() {
            //let workrequest = new Option('WorkRequest', '1');
            var x = document.getElementById("ddlServices");
            console.log(x);
            var id = x.options[x.selectedIndex].value;
            console.log(id);
            $('#contenttable').empty();
            $('#contenttable').append('<table id="gridview" class="table table-striped table-bordered dataTable wrap" style="width: 100%"><thead></thead><tbody></tbody></table>');
            document.getElementById("lblHeading").innerText = "<%=Resources.Resource.msg_grid_loading %>"//"Loading...."
            RenderData(id);
        }

Shresh
  • 11
  • 3
  • https://api.jquery.com/append/ also https://stackoverflow.com/search?q=%5Bjquery%5D+add+option – freedomn-m Apr 26 '21 at 08:52
  • Hi,thanks freedomn-m, but recently only i have started learning Jquery , so donot know much , can you please give me the solution with the above provided code only please. – Shresh Apr 26 '21 at 11:19
  • `$('#ddlServices').append($("");` I recommend you have a good read through https://learn.jquery.com/ – freedomn-m Apr 26 '21 at 11:57

0 Answers0