Enter HTML Code
Validation Results
Click "Validate HTML" to check your code
Split View - Editor & Preview
📝 Editor
Preview
Update preview to see rendered HTML
🌟 HTML Showcase - Custom HTML spam>
tag
This custom HTML tag repeats stuff for however many times chosen, with an optional separator.
Examples
Periods
Exclamation points
Ha's
Lateral click
Dashes
Stars
You want to know how to do this in your own html?
First, you need javascript, so copy and paste this:
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('spam').forEach(el => {
const times = parseInt(el.getAttribute('times')) || 1;
const separator = el.getAttribute('separator') || '';
const text = el.textContent;
el.textContent = Array(times).fill(text).join(separator);
});
});
</script>
Then, to actually use it as if it was an html element, use the <spam></spam>
tags with the parameter times
to specify how many times the thing is repeated, for example <spam times="9">oo</spam>
. There is also an optional parameter separator
, which specifies which thing separates the repeating stuff, for example <spam times="9" separator=" ">oo</spam>
, but the times
parameter is not optional.