I've not found a solution to this one yet, say for example a h tag has a span tag in it as well for some words but the whole h tag needs to be editable, is there a way that when it's edited that the span tag remain in place, for example the non couch code is like the following
I have managed to do it using some jquery code, below is the updated code if it's any good to anyone
- Code: Select all
<h5>COMPUTER REPAIR <span>FAST</span> AND <span>SECURE</span></h5>
I have managed to do it using some jquery code, below is the updated code if it's any good to anyone
- Code: Select all
<h5 class="introsubtitle">COMPUTER REPAIR FAST AND SECURE</H5>
h5.introsubtitle span{color:#8d17b9}
<script>
var words = $('h5.introsubtitle').text().split(' ');
var numWords = words.length;
for (i=0; i<numWords; i++) {
if (i%2 == 0 && i > 1) {
words[i] = '<span>' + words[i] + '</span>';
}
}
$('h5.introsubtitle').html(words.join(' '));
</script>