Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Best practice: Remove active state from dropdown menu Re: Best practice: Remove active state from dropdown menu

#105407
littleGiant
Member

I tried to apply you solution to my example where more than one button could appear within the DOM. Don’t know if it is worth the effort though, it just feels cumbersome.

Solution 1: Remembering the previously clicked button
http://jsfiddle.net/mGAs4/4/

Solution 2: Removing active states recklessly
http://jsfiddle.net/mGAs4/5/

I think this topic is not really interesting in terms of performance, but I was just wondering how others would approach this problem.