I am playing with pseudo elements and javascript but some how i can not style it using javascript.
If you want to style pseudo elements from javascript you have to use the CSSOM to inject the rules. It's not trivial, but it's possible.
var sheet = document.styleSheets[0]; //get style sheet somehow
var rules = sheet.rules;
sheet.insertRule('div:before { display: none; }', rules.length);
a slightly modified example from this article
CCSOM Reference