Drucken Sie farbigen Text JavaScript drucken
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
If-dev
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
<script>
document.getElementById('change').onclick = changeColor;
function changeColor() {
document.body.style.color = "purple";
return false;
}
</script>
element.style.color = '#f0f';
document.getElementBiId("your id").style.color = "your color";
//it can also be used as:
document.body.style.backgroundColor = "your color";
var all = document.getElementsByTagName("*");
for (var i=0, max=all.length; i < max; i++) {
all[i].style.color = "red";
}
var span = document.getElementsByTagName("span")[0];
span.style.color = "red";