Dear smokey_gun
When browser reaches "img.onclick = removeRow('this');" statement, tries to run "removeRow" method and pass it a string argument ("this"), and then assign it's return value to "onclick" property of "img" element.
You can't assign an event handler to an element using 'name=value' syntax. You should use an special method of your element (in this case your 'img' element) named 'attachEvent'. It takes two parameters, the first one is string that contains name of event (like "onclick" or "onmousedown") and the latter is name of function that you like to assign to that event.
Note : Remember that second parameter is not a string, it's a function pointer. For example your statement will be changed to :
img.attachEvent("onclick",removeRow);
Bye bye
Ehsan Zaery Moghaddam
|