Recently I made a archive box for my blog. Firstly I use style attribute for styling my list. But when I moved the css code in style attribute to a separate css file, my JS code didn't work. The following codes work fine when click the -> button.

But when I use class of css instead of style attribute, the JS code doesnt't work. I cannot see the sub list items on the screen when I click the -> button. So I don't want to use style attribute. Because it easy to read style code from css file in my website. What can I do for handling this problem? Any suggestion?

Note: Because "insert into post" button in code snippet tool doesn't work, I put codes as images into my post.