I am using prototype to change the onclick function of the button. The following code is working well.
$('button_id').setAttribute('onclick','test();');
but the following is not working
$$('div#divid button.buttonclass').setAttribute('onclick','test();'); or
$$('button.buttonclass').setAttribute('onclick','test();');
I just want to change the button onclick function. The button is inside a div element. Button has the class name button only and do not have the id attribute.
Try:
Or
Class selector returns matching elements in form of ARRAY.