<head>
<style>
.name2 {
color: red ;
}
.name3 {
background: blue ;
}
</style>
<script src = "http://code.jquery.com/jquery-latest.min.js"></script>
<script>
var firstName = ".name1",
secondName = "name1" ;
$(document).ready(function() {
$(firstName).addClass("name2") ;
$("." + secondName).addClass("name3") ;
});
</script>
</head>
<body>
<div class = "name1">This is super div.</div>
</body>