javascript - onclick is not working with document.getElementsByClassName -
    i have accordion menu using product descriptions in cms trying develop javascript/css/html  speed data entry having same class name encapsulate sections , subsections. saw on website , thought cool, cannot work.   e.g sections this:   <button class="accordion_f">section 1 title</button> <div class="panel">  <button class="accordion_f">section 1 subsection title</button>  <div class="panel">  section 1 contents</div> <button class="accordion_f">section 2 title</button> <div class="panel">  <button class="accordion_f">section 2 subsection title</button>  <div class="panel">  section 2 contents</div>  , on...  section 1  section 1 contents  section 1 contents section 2   section 2 contents  section 2 contents , on   this way can cut , paste content without worrying specific div id names.   css       <style> button.acc...