Hi all,
I am working on Dynamic table.
I am creating the new row each time by using add button.
But i in each row i am adding new text boxes, i want to add function to
these textboxes like onclick="dosome fuction()" like this.
The code look like this:
el.onchange = function (evt) { anyFunctionThis TextBoxMightNee d() };
In this perticular line i have added my function just like this,
el.onchange = function (welcome) { alert("Welcome" ); };
But code is not working.
Please help me!!
Thanks in advance.
I am working on Dynamic table.
I am creating the new row each time by using add button.
But i in each row i am adding new text boxes, i want to add function to
these textboxes like onclick="dosome fuction()" like this.
The code look like this:
Code:
function createNewTextBox(){
var myTable=document.getElementById('myTable');
var plastron=myTable.rows.length;
var rows = myTable.getElementsByTagName('tr');
var cels = rows[plastron-1].getElementsByTagName('td');
var row = myTable.insertRow(plastron);
var cell = row.insertCell(1);
var el = document.createElement('input');
else('type', 'text');
else('name','myName');
else('value', '');
else('size', '10');
else('maxLength', '10');
el.onchange = function (evt) { anyFunctionThisTextBoxMightNeed() };
cell.appendChild(el);
In this perticular line i have added my function just like this,
el.onchange = function (welcome) { alert("Welcome" ); };
But code is not working.
Please help me!!
Thanks in advance.
Comment