I have a select box with the onChange attribute. Now, after loading a shared page based on some conditions, I have to add 'onChange' for the javascript selection window. I am trying to use the following code. But that does not work.
$("#depositForm").attr(("onChange", "selectedMainDepositType('this');" ));
The onChange event is not added.
<select id="depositForm_depositSubType" class="depositSubType" style="width:160px;" name="depositSubType">
need to change how
<select id="depositForm_depositSubType" onchange="selectedMainDepositType(this);" class="depositSubType" style="width:160px;" name="depositSubType">
Please suggest how to add the onChange attribute.
source share