C
Cui
Hi, and sorry for my poor english
I have dynamically created some checkbox in a table, and I have also
attached to it some event.
mycurrent_cell = document.createElement("TD") ;
chbox = document.createElement("INPUT") ;
chbox.type = "CHECKBOX" ;
chbox.name = "CHB_" & col_i ; // col_i is an integer....
chbox.attachEvent("onclick", chbox_click) ;
chbox.attachEvent("ondblclick", chbox_dblclick) ;
In the chbox_click and chbox_dbclick functions, I want retrieve the element
which has generated the action. I tried to get it by the name:
element = event.srcElement ;
element.name => always returned the value : 1
Then , I want to know how I can do it.When ones uses attachEvent method, the
2nd parameter is the name of the function, but it is impossible to pass some
parameters.
Do I must change the attachEvent call, or use anything else of event and
event.srcElement..
Thanks
Cui
I have dynamically created some checkbox in a table, and I have also
attached to it some event.
mycurrent_cell = document.createElement("TD") ;
chbox = document.createElement("INPUT") ;
chbox.type = "CHECKBOX" ;
chbox.name = "CHB_" & col_i ; // col_i is an integer....
chbox.attachEvent("onclick", chbox_click) ;
chbox.attachEvent("ondblclick", chbox_dblclick) ;
In the chbox_click and chbox_dbclick functions, I want retrieve the element
which has generated the action. I tried to get it by the name:
element = event.srcElement ;
element.name => always returned the value : 1
Then , I want to know how I can do it.When ones uses attachEvent method, the
2nd parameter is the name of the function, but it is impossible to pass some
parameters.
Do I must change the attachEvent call, or use anything else of event and
event.srcElement..
Thanks
Cui