This code would speak for it self and explain what I'm trying to achieve...
<style>
.red{background:red}
.blue{background:blue}
</style>
<div id=test>
<button>1</button>
<button>2</button>
</div>
<script>
var firstBtn=document.getElementById("test").firstChild.className;
(firstBtn!="red")?firstBtn="red":firstBtn="blue";
</script>
Here is the jsFiddle : http://jsfiddle.net/hnfeje2q/
Very simple but since I'm new to JavaScript...
Thanks!