I have a span with inner span and I'm trying to get the first character of the inner span (t) and change its color. I tried to do that with many way with both JavaScript and jQuery and it doesn't work
// with javascript
var index = document.getElementById('spa');
var indexsl = index.slice(0, 1);
indexsl.style.color = "f00"; //doesn't work
var index = document.getElementById('spa');
var indexsl = index.substring(0, 1);
indexsl.style.color = "f00"; //doesn't work
var index = document.getElementById('spa');
var indexsl = index.charAt(0, 1);
indexsl.style.color = "f00"; //doesn't work
// with jQuery
var index = $('.design span').charAt(0);
index.css('color', '#f00') // doesn't work
var index = $('.design span').substring(0, 1);
index.css('color', '#f00') // doesn't work
var index = $('.design span').slice(0, 1);
index.css('color', '#f00') // doesn't work
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span class="design">DESIGNED BY <span id="spa">Teodor Victor</span></span>
spanwould be the obvious choice) and assign a style to that tag