TechCodex to Programmer [email protected]English • 2 years agoJavascript can create atomic bombsprogramming.devimagemessage-square63fedilinkarrow-up1654
arrow-up1654imageJavascript can create atomic bombsprogramming.devTechCodex to Programmer [email protected]English • 2 years agomessage-square63fedilink
minus-squareexscapelinkfedilink24•2 years agoCSS is used to create the design, basically the look (colors, layout and so on), but no substance. JavaScript is used to implement code and logic. HTML + JavaScript would typically (since you’re supposed to use CSS to create colors and design) look very dull, thus the black-and-white Oppenheimer.
minus-squareRikudou_SagelinkfedilinkEnglish2•2 years agodocument.querySelector('.whatever').style.color = "red"; Don’t recommend, though.
minus-squareexscapelinkfedilink2•2 years agoSure, but setting the .style attribute could really be argued as using CSS, just with a different interface. W3Schools refers to this as “inline CSS”.
CSS is used to create the design, basically the look (colors, layout and so on), but no substance.
JavaScript is used to implement code and logic.
HTML + JavaScript would typically (since you’re supposed to use CSS to create colors and design) look very dull, thus the black-and-white Oppenheimer.
document.querySelector('.whatever').style.color = "red";
Don’t recommend, though.
Sure, but setting the .style attribute could really be argued as using CSS, just with a different interface. W3Schools refers to this as “inline CSS”.