Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<title>Wrapping a span tag demo</title>
<style type="text/css">
span {
color: red;
}
</style>
<script type="text/javascript">
function insertSpan(word) {
var re = new RegExp(word,"gi");
var paragraphs = document.getElementsByTagName('p');
for (var loop=0,max=paragraphs.length; loop<max; loop++) {
var paragraph = paragraphs[loop];
var words = paragraph.innerHTML;
words = words.replace(re,'<span>'+word+'</span>');
paragraph.innerHTML = words;
}
}
</script>
</head>
<body onload="insertSpan('woolly')">
<p>The woolly cat sat on the woolly mat and was happy.</p>
</body>
</html>