I was wondering whether there is a good way of attaining the following: I select a HTML class, marked with a certain CSS class (say <span class="myclass">My content</span>) and I want the browser to render it as the text "My content" customized in some weird ways, for instance in this way: I write
<span class="myclass" data-image="myimage.jpg" data-title="My Title">My content</span>
and I get it replaced with
<h1>My Title</h2> My con<img src="myimage.jpg">en<img src="myimage.jpg">
(one occurrence of the image for each 't'.
I mean, I would like some Javascript code to be executed with arguments the inner HTML and the attributes of my <span class="myclass"> tags; this code should have the effect of replacing my HTML tag with some more complicated HTML code, but keeping it in exactly the same position in the HTML page. Is it possible to do it?
Sorry for my awful way of posing the question, but I am an autodidact in HTML and Javascript!