JavaScript – Format HTML with JavaScript code
Have you ever tought of formatting HTML with JS in stead of CSS? Why have you tought about it?
Anyway, if playing with formats is your thing, here is a small example how to achieve the following picture with JS formatting over the HTML:
The code:
<html>
<head>
<title>VitoshAcademy.Com</title>
</head>
<body>
<script>
var vkd = "vitoshacademy.com";
document.write("As is -> " + vkd + "<hr>")
document.write("Bold -> " + vkd.bold() + "<hr>")
document.write("Italic -> " + vkd.italics() + "<hr>")
document.write("Fixed -> " + vkd.fixed() + "<hr>")
document.write("Big -> " + vkd.big() + "<hr>")
document.write("Small -> " + vkd.small() + "<hr>")
document.write("Sub -> " + vkd.sub() + "<hr>")
document.write("Sup -> " + vkd.sup() + "<hr>")
</script>
</body>
</html>
Enjoy it!
