<script type="text/javascript">
window.onload = function(){
var inp_pass1 = document.getElementById('password');
var inp_pass2 = document.getElementById('re-password');
if(inp_pass1 != null && inp_pass2 != null){
if(inp_pass2.innerHTML == inp_pass1.innerHTML) {
alert(inp_pass2.className='input-yes');
}
else {
alert(inp_pass2.className='input-no');
}
}
};
</script>
<div id="password">1</div>
<div id="re-password">2</div>