JavaScript function class
function showhide(obj){ The code is fine,
I don’t know if you want to say why only one div is shown and hidden.
Next itself can only select one div. If you want to get all the divs after the a tag, use the nextAll method. The JQ I use is version 1.7.2
The code is fine!