I have this in html
<div id="content">
<h1 class="entry-title">"Homepage SlideShow"</h1>
</div>
I also have this in js
var content = document.getElementById("content");
var entryTitle = content.getElementsByClassName('entry-title')[0];
var str = entryTitle.innerHTML;
var newTitle = "";
for (var i = 0; i < str.length; i++) {
if (str[i] == 'e') {
newTitle += str.charAt(i).fontcolor("red");
}
else {
newTitle += str[i];
}
}
entryTitle.innerHTML = newTitle;
I added a color on the targeted letter but I don't have an idea how to add a margin. I want to add margin on the targeted letter like margin = -20px;. I'm new to javascript and I'm hoping someone could help. Thanks
Here's my JSFiddle
Edit:
I have this font that doesn't look good on letter spacing. I don't want to use a span class in my html since I don't want to do it manually on every single page or post that I make.
For example: I want to move all i's to the left since it has the same spacing in any word.