User defined tags?

Posted on 2005-05-01
Last Modified: 2010-04-09
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.
Question by:rblampain
    LVL 30

    Accepted Solution

    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;
    LVL 19

    Assisted Solution

    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.


    Author Comment

    Thank you both. I won't upset the HTML interpreter, I can solve my problem some other way.
    LVL 19

    Expert Comment

    Glad to have been helpful :)

    LVL 30

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now