devote,
Вариант...без повторов
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
function setPseudoContent(value)
{
var style = document.getElementById('style_before')
if(!style){
style = document.createElement('style');
style.id = 'style_before';
var head = document.getElementsByTagName('head')[0];
head.appendChild(style);
}
style.innerHTML = "span:before { content: '"+value+"' }"
}
</script>
</head>
<body>
<input onkeyup="setPseudoContent(this.value)" />
<span> проверка</span>
</body>
</html>