<style>
.foo {
color: red; <-- how to change this from jquery
}
</style>
How can I change default css from jquery without $() selector? so entire elements contain class will changed?
<style>
.foo {
color: red; <-- how to change this from jquery
}
</style>
How can I change default css from jquery without $() selector? so entire elements contain class will changed?
you can use javascript :
<head>
<link id="style" rel=stylesheet href="large.css">
</head>
function changeStyle(){
if(window.innerWidth<900){
document.getElementById("style").setAttribute("href","small.css");
}else if((window.innerWidth)>900 &&(window.innerWidth)<1200){
document.getElementById("style").setAttribute("href","medium.css");
}
else
document.getElementById("style").setAttribute("href","large.css");
}
window.onresize=changeStyle;
changeStyle();