Click here to Skip to main content
15,903,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all....
i add a button at run time
but i cant perform onclick event, its not execute the event

C#
var bt = document.createElement('input');
                bt.type='button';
                bt.id='btremoveval';
                bt.value='Remove';
                bt.onclick='move_back()';



C#
function move_back(obj)
   {
    alert('hi');
   }

event is not execute..
Posted

Hi,

Please have a look into answer in this question[^]

Hope you got answer from above link, Let me know if you have any query.

Thanks
-Amit Gajjar.
 
Share this answer
 
v2
Comments
Skvignesh 14-Aug-12 5:00am    
thanks for ur response.
but i need it in javascript
AmitGajjar 14-Aug-12 5:03am    
please check my updated answer.
C#
var bt = document.createElement('input');
                bt.type='button';
                bt.id='btremoveval';
                bt.value='Remove';
                //bt.onclick='move_back('+val+')';
                bt.onclick=function(){ move_back(val)};



it working thanks for ur reply
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900