I am trying to color some users' names on some forum (http://forum.hardware.fr/hfr/Discussions/politique/american-politics-president-sujet_71396_2268.htm)
so I've made a bookmarklet :
Array.prototype.forEach.call(document.getElementsByClassName('s2'), function(img) {
if (['Theomede', 'doublebeurre'].indexOf(img.innerHTML) > -1) {
img.style.color = 'Red';
}
});
However, it doesn't work for the user "doublebeurre". I wanted to know why, so while debugging, I did :
img.innerHTML.length returns 13, while 'doublebeurre'.length returns 12.
img.innerHTML.split("") returns ["d", "o", "u", "b", "l", "e", "b", "e", "u", "r", "", "r", "e"]
What is this empty character ? How can I make my script work on this user ? (img.innerHTML.trim() doesn't solve the problem)