I have a menu with the :only-child selector so that I can indicate submenus. The :after selector works in IE8 (the only old IE version I have to support), but the :only-child selector does not, so I get an arrow on every menu item, not just on the ones with a submenu.
.menu li > a:after { content: ' ▾'; }
.menu li > a:only-child:after { content: ''; }
What I want is to achieve this using jQuery or JavaScript. I don't want to use Modernizr or Selectivizr and all that stuff, just a single code as an alternative to only-child.
I would really appreciate if you could help me out. I am a newbie when it comes to jQuery and JavaScript, so please explain thoroughly. Thanks!