Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<style>
 div.circlea{
background-color: #d0e4fe;
width: 15px;
    height: 15px;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
}
 div.circleb{
background-color: #66FF99;
width: 15px;
    height: 15px;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
}
  
div.circlec{
background-color: #FFCCCC;
width: 15px;
    height: 15px;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
}
  
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
    // var mb = $('#state').text();
    var mb=document.getElementById("state").getAttribute('value');  
      if(mb ==1){
      $('#demo').removeClass().addClass("circleb");
      
     }
      else if (mb==2){
        $('#demo').removeClass().addClass("circlec");
      }
    });
</script>
</head>
<body>
  <div><div id="demo" class="circlea"></div><div id="state" value="1"></div></div>
  <div><div id="demo" class="circlea"></div>
    <div id="state" value="2"></div></div>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers