Relative Content

Tag Archive for attributes

Should I put the datatype of a class attribute in its name?

Most of my system’s class attributes are just text, but in this case it makes more sense to place this particular class’s attributes into one single hash (from a “keep the source code pretty” aspect). Basically, a list of attributes is returned, and instead of writing a bunch of static attributes for each one, I just loop over them and collect them into a hash.

Should I mark what blocks mean in data-* attributes?

I was writing a webpage today with a comment after the start of every major section. Instead of using a comment, which comes with the bulgy <!-- --> syntax, could I instead put this in a data-* attribute? This would be more for me than anything else, so I don’t want to put it in an id or class, but it would also leave it open for userscripts to more easily parse the page.

Should I mark what blocks mean in data-* attributes?

I was writing a webpage today with a comment after the start of every major section. Instead of using a comment, which comes with the bulgy <!-- --> syntax, could I instead put this in a data-* attribute? This would be more for me than anything else, so I don’t want to put it in an id or class, but it would also leave it open for userscripts to more easily parse the page.