Hello i have a td in table with value i have changed this td to an input of type text when a click to a button.
And now i want to change the id of the new input with the id of the td element so i have an exception that is :
input.id is not a function
Here my code js :
$("tr.forc td.TdbeforeForcage").each(function () {
var html = $(this).html();
var input = $('<input class="numberforce" style="width:50%" type="text" />');
var IdTd = $(this).attr("id");
input.val(html);
input.id(IdTd); // Here trying to change id of input with id of td
$(this).html(input);
if (html.indexOf(' ') > -1) {
var newValue = html.replace(' ', ' ');
$(this).find('input.numberforce').val(newValue)
}
});