You cannot modify pseudo-elements with jQuery (unless you want to add <style>
tags). You can, however, change your CSS to make this easier:
content: attr(data-text);
The text will be contained within an attribute on the element:
<div data-text="This is the default text">Test</div>
Now, you can change the attribute with jQuery and the text will change:
$('h1').attr('data-text', 'This is some other text');
Demo: http://jsfiddle.net/8qNjv/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…