BB Learn JQuery - Dynamic elements

Discussion created by aa0045190 on Jul 19, 2016



I used jquery to create many dynamic elements because I don't know the count of these lists.

specifically, in the same page I add two select lists each time we clic on specific button.

The main issue is that I had to update the second lists each time the chosen option in the first list is changed.

Can you tell me how to update dynamic element (input).

Above a code part:


$(listC).live('change', function(e) {



       function ajaxcall2(){


          type: "post",

          url: '/webapps/ABC-MCAA-BBLEARN/searchFolderOptions',

          data: "selectedCourse="+e.target.name,


          success: function(response){


                  var obj = JSON.parse(response);



          var numval = "#inputt"+obj.substring(13)+"";


          var newdivi="#newdiv"+obj.substring(13);

          $("<p>Yepppp</p>").appendTo(numval).appendTo(newdivi); ;


          error: function(e){

          alert('Error while request..');






Also, I tried to clear dynamic element content through jquery .empty(); but It did not work.


Any suggestions please ?