I tried to insert input box with id as tags.
After insert, I need the auto complete to function.
tried many ways but the input with tags cannot auto complete.
function addRow(row) {
var table = document.getElementById('dataTable');
var rowCount = table.rows.length;
var newRow= table.insertRow((1));
var row = newRow.insertCell(1)"
row.innerHTML+="<INPUT id =tags>";
}
$(function() {
var availableTags = [
"abc",
"bcd",
"EGF"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
Where shall I place my autocomplete to enable the function for the new ?
row.innerHTML+="<INPUT id =tags>";this rowshould be
row.innerHTML+='<INPUT id="tags" />';and make sure you call $( “#tags” ).autocomplete() after you addRow