In HTML 5 you're allowed to add any attribute starting with data-
, so e.g. <div data-messid="12">
is OK.
HTML 4 and XHTML 1 won't validate if you add your own attribute, but besides that nothing bad will happen if you choose attribute name unique enough (so it won't conflict with any current or future HTML attribute).