opinion: html, illusory register ids non-standard attributes?
it seems graceful common wish let your javascript know sole dom node corresponds record database. so, it?
one proceed i've seen that's graceful common category form an id id:
<div class="thing" id="5">
<script> mything = select(".thing#5") </script>
there's slight html standards emanate nonetheless -- have some-more form record page, competence finish adult duplicating ids. nonetheless doesn't anything bad, does it?
an choice information attributes:
<div data-thing-id="5">
<script> mything = select("[data-thing-id=5]") </script>
this gets around register ids problem, nonetheless does meant have understanding attributes instead ids, infrequently some-more difficult. guys think?
Comments
Post a Comment