Here is the piece of code which contains two CSS elements. del and ins
I want to include the whole CSS code into Javascript... But the code is one level above my experience...
Here is the CSS code:
del {
text-decoration: none;
color: #b30000;
background: #fadad7;
}
ins {
background: #eaf2c2;
color: #406619;
text-decoration: none;
}
And here is the piece of code which contains those classes:
convertChangesToXML: function(changes) {
var ret = [];
for (var i = 0; i < changes.length; i++) {
var change = changes[i];
if (change.added) {
ret.push("<ins class='diff'>");
} else if (change.removed) {
ret.push("<del class='diff'>");
}
ret.push(escapeHTML(change.value));
if (change.added) {
ret.push('</ins>');
} else if (change.removed) {
ret.push('</del>');
}
}
return ret.join('');
},
How to include CSS into Javascript here?
I don't want a separate CSS file ... Because I'm using a third party app called Storyline to create a web page and it's a lot easer to run a javascript code there without a css file