storing information in ID's and CLASS's

storing information in ID's and CLASS's

Hi All,

I tend to store information that I would need (for example in an onclick function) in classes and id's. Is this good practice? Are there other ways to store information?