Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39671

Using HTML5 templates

Newsgroups comp.lang.javascript
From Andrew Poulos <ap_prog@hotmail.com>
Subject Using HTML5 templates
Date 2021-03-17 15:40 +1100
Message-ID <HISdnR0V-cLSFcz9nZ2dnUU7-bfNnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


If I have a simple template that looks like this

<template id="my-paragraph">
   <p id="foo">My paragraph</p>
</template>

When I clone the template multiple times I have multiple elements with 
the id of "foo".

So if the template I've be given to use is fairly large (with many 
elements with IDs) how would I use it? I suspect that before the clone 
is appended to the DOM I'll need to loop through all the elements and 
edit the IDs so that they are unique - which complicates referencing them.

Is this correct or am I misunderstanding how a is to be used template?

Andrew Poulos

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Using HTML5 templates Andrew Poulos <ap_prog@hotmail.com> - 2021-03-17 15:40 +1100
  Re: Using HTML5 templates "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-17 06:08 -0700
    Re: Using HTML5 templates Andrew Poulos <ap_prog@hotmail.com> - 2021-03-18 07:47 +1100

csiph-web