Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getting reference of dynamically created field  RSS feed

 
swapnil kataria
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the below code is adding a row in a table with a td of input, i am giving name of input is xyz, but when i tries to get refernce by using
document.getElementsByName("xyz")[0].value, then it is not picking its value

var tbl = document.getElementById('tblAddress');
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
var cell0 = row.insertCell(0);
var el = document.createElement('input');
el.type = 'text';
el.NAME = 'xyz';
el.size = 30;
cell0.appendChild(el);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!