I'm making a standard hierarchy (or tree) control in which any node with children will have a button to hide/show subnodes. So I'd like to have some way to associate the button with the div that it hides/shows. With code sort of like this:
$(".hideShow").click (function () {
  var $subject = getHideShowSubject (this);
  toggleHideShowSymbol (this);
The getHideShowSubject function would need to access an encoding of a pointer from the button to the subject div (in html).

Is there a conventional way to encode that pointer in HTML? One way to do it would be with HTML5 custom attributes, but what was the convention before HTML5?