urlmatch

urlmatch

by waohayashida

HTML

<div class="addhere">
    add
</div>

CSS

.addhere{
  width: 300px;
  height: 300px;
  background-color: yellow;
}

.addclass{
  color: red;
  font-size: 30px;
}

JavaScript

$(function(){
		var url = location.href;
    console.log(url);
    
    var path = location.pathname;
    console.log(path);
    
    var param = location.search;
    console.log(param);
    
  	if(param.match("dis")){
  		console.log("load!");
  		$("div.addhere").addClass("addclass");
  	} else{
  		console.log("no");}
});