• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

User defined tags?

I learned a bit of HTML a few years ago and I have a vague recollection about reading something about "user made tags" but I can't find anything.

My question: Is it acceptable to define an HTML tag, for example <H23></H23> or <Ha></Ha>? My vague recollection is that HTML would consider it as invalid and ignore it which would be perfect for what I want to do because this tag can be used by scripts.

If you have a better idea to achieve the same goal then I'd definitely welcome your examples.

Thank you for your help.
0
rblampain
Asked:
rblampain
  • 2
  • 2
2 Solutions
 
GrandSchtroumpfCommented:
Use defined tags are not allowed in html.

The closest thing you can do is to use the "class" attribute:
<div class="Ha">Hello</div>

Then you can use CSS to style your class:
div.Ha {
  color: red;
}
0
 
DreamMasterCommented:
You should not use this trick to use it for scripts. Yes, they are ignored in HTML and therefor it would seem that it does what you would like, and NO it's not good to do it that way. Better is to use the method GrandSchtroumpf suggested, or something similar.

Regards,
Max.
0
 
rblampainAuthor Commented:
Thank you both. I won't upset the HTML interpreter, I can solve my problem some other way.
0
 
DreamMasterCommented:
Glad to have been helpful :)

Regards,
Max.
0
 
GrandSchtroumpfCommented:
<:°)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now