javascript - Do custom markup tags placed in an HTML document affect the flow and is it possible to parse them with JS? -
this question has answer here:
- is there way create own html tag in html5? 17 answers
would possible following
<body> <main> <!-- content --> </main> <foot> <!-- footer content --> </foot> </body>
if wrote javascript did along lines of following. please note don't want write actual code goes here. mockup of core functionality.
for(elem inside main){ elem.makeitbig(); } for(elem inside foot){ if(elem img){ elem.makeitsmall(); } }
i aware of post is there way create own html tag in html5?. don't want create tags style them rather provide identifying attributes dom can hook using javascript. imagine kind of class, used in way can stitch lots of php generated parts using these tags.
if use made tag in html ignored browser or throw error.
you can use own tags far i'm aware.
you'd need mucking them work in older ie browsers.
the more important point - why on earth want to? wouldn't make code maintainable or future-proof. use classes on proper elements.
Comments
Post a Comment