I'm grabbing the text value from a div, setting it as a variable, and then I need to add parenthesis and a backslash to it. The end result should be: "\f333". Once I have "\f333", I need to add this to a pseudo element.
HTML
<div class="icon">f333</div>
jQuery
var iconOne = """ + "\" $('.icon').text() + "";
$('.nav:before').css('content', iconOne);
CSS (What I want the end the result to be:
.nav:before {
content: "\f333";
}
Unfortunately, the CSS isn't being applied to the pseudo element and I think it has to do with the jQuery. Any help in applying the parenthesis and backslash correctly, please?