Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142054 | Jan 16,2019 07:52 PM UTC | Jan 18,2019 05:07 AM UTC | ASP.NET Core - EJ 2 | 3 |
![]() |
Tags: Dropdown List |
<script type="text/javascript">
// Incremental variable to set unique ID attribute
var count = 0;
// Click handler
function onClick() {
// Incrementing the value upon every click
count++;
// Dynamically creating an input element
var inputEle = document.createElement('input');
// Setting ID attibute to the dynamic inputs
inputEle.setAttribute('id', 'dropdown' + count);
// Appending the created element to the DOM
document.getElementById('renderdropdown').appendChild(inputEle);
// Datasource for the DropDownList
var sportsData = ['Badminton', 'Cricket', 'Football', 'Golf', 'Tennis'];
// Rendering the DropDownList
var listObj = new ej.dropdowns.DropDownList({
dataSource: sportsData,
placeholder: "Select games"
});
listObj.appendTo(inputEle);
}
</script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.