::-webkit-input-placeholder{
text-align:right;
}
:-moz-placeholder{
text-align:right;
}
::-moz-placeholder{
text-align:right;
}
:-ms-input-placeholder{
text-align:right;
}
<script>
$(document).ready(function(){
$width = $('.block').width();
if($width > 30) {
$('.block').css('background','red');
}
});
</script>