if URL Has X change CSS
This reads the URL in the browser and performs the if statement
by Colin Soderstrom
HTML
<div id="urlFid1">
<p>This div is not changed</p>
</div>
<div id="urlFid2">
<p>This div changes</p>
</div>
CSS
#urlFid1 {
background-color: red;
padding: 10px;
margin: 10px;
}
#urlFid1 p {
font-family: Arial, Helvetica, sans-serif;
}
#urlFid2 {
background-color: red;
padding: 10px;
margin: 10px;
}
#urlFid2 p {
font-family: Arial, Helvetica, sans-serif;
}
JavaScript
if (window.location.href.indexOf("fiddle") > -1) {
$("#urlFid2").css("background-color", "blue");
}