how to use js in css code example
Example 1: javascript modify css
var el = document.getElementById("elementID");
el.style.css-property = "cssattribute";
el.style.backgroundColor = "blue";
$("#elementID").css("css-property", "css-attribute");
$("#elementID").css("background-color", "blue");
$("#elementID").css({"css-property": "css-attribute", "css-property": "css-attribute"});
$("#elementID").css({
"css-property": "css-attribute",
"css-property": "css-attribute"});
Example 2: how to give css style in javascript
document.getElementById("myH1").style.color = "red";
Example 3: html css js
<!DOCTYPE html>
<html lang="pt-br" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>...</title>
</head>
<body>
...
<script type="text/javascript" src="script.js"></script>
</body>
</html>
Example 4: include javascript in html
<script>
</script>
Example 5: how to change css using javascript
document.getElementById("myText").className = "anyNewClass"