Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a NO-OP tag in HTML?

I am looking for a tag that i can use to mark out a position in the html, which i can then find later using JQuery. However, I need the tag to be as useless as possible: even empty divs and spans can cause the layout to change depending on the CSS rules you set. For that matter, even rubbish tags that html doesn't understand seem to acquire styles from css, and I don't think there is any way to find comments via DOM traversal?

This tag will be used to mark out the start and end of a chunk of HTML to be Ajaxed. I do not want to wrap the whole chunk in a div or span (which i what i'm doing now), because this can affect how the CSS cascades and i want the fact that the html is marked out as a chunk to be completely transparent to the programmer (me).

Any ideas?

edit: I just thought of using empty script tags. Those should be completely inert and invisible. I shall look into it

edit: How could i forget about display: none? stupid stupid stupid

like image 964
Li Haoyi Avatar asked Aug 01 '11 05:08

Li Haoyi


1 Answers

Can you use comment tags: <!-- whatever -->? Parser would allow you to distinguish it.

like image 88
Alex Gitelman Avatar answered Sep 26 '22 22:09

Alex Gitelman