Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js dom after selectors

var str = "bar";

document.styleSheets[0].addRule('p:before', 'content: attr(data-before);');

$('p').on('click', function () {
    $(this).attr('data-before', str);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #dom #selectors
ADD COMMENT
Topic
Name
6+1 =