1

Is it possible to create HTML functions like you can do with... I don't know... JS?

Could you do something like this?

<!DOCTYPE html>
  <html version=5>
    <body>
      <function name="para" attr1="text">
        <p localName="para"></p>
        <script type="functionHTML/javaScript">
          function.data("attr1")includes = getLocalElementByName("para")
        </script>
      </function>
      <-para text="Hello World!"></-para>
    </body>
  </html>

This would come out on the webpage as:

Hello World!

1
  • I find it funny we've come full circle back to wanting XML on the web. Commented Nov 4, 2016 at 14:47

2 Answers 2

1

Not in general HTML, no. However, there are specifications, centrally the Custom Elements spec, and projects build around it, which enable you to define and reuse your own HTML elements.

Sign up to request clarification or add additional context in comments.

Comments

0

You can't create html functions, but the JS is here to create functions and manipulate the DOM, so you can do that whit JS (use jQuery, it's easier)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.