My javascript code something like this
if (editMode === true) {
    var divId = element.attr('id');
    console.log(divId);
}
var textBox = $('<input class="my-text-box" onchange="myFunction(this.value)" />');
I want to set divId variable as the ID in this... 
var textBox = $('<input class="my-text-box" onchange="myFunction(this.value)" />');
this divId variable is with dynamic values...
please help me to do that.
 
     
     
     
    