问题
I wanted to copy one click event from one element to another i am doing in following mannner which is not working
var arr = $("#engagement_box_content_generic_mention>.data_box>.load_mentions_data_box");
$.each ( arr , function( key , value){
console.log( $(this).attr("onclick") );
if ( key == 0 ) {
$("#abc").click( $(this).attr('onclick') );
}
});
console.log gives me like this print_1317(1317, 201205, 24, 11, 'no');
but when i click on applyed element abc it gives error
Uncaught TypeError: Object print_1317(1317, 201205, 24, 11, 'no'); has no method 'apply'
thanks in advance
来源:https://stackoverflow.com/questions/10741588/uncaught-typeerror-object-functionarg1-arg2-has-no-method-apply