I want to change this CSS text-align. it’s right but I want it to be left.
<div class="btn_gonder" id="ContentPlaceHolder1_btnform">
<input border="0" type="image" style="height:36px;width:97px;" src="../style/images/btn_gonder.png" alt="Gönder" id="ContentPlaceHolder1_ImageButton1" name="ctl00$ContentPlaceHolder1$ImageButton1"></div>
CSS AREA
.select_container .btn_gonder {
float: left;
height: 36px;
text-align: right;
width: 304px;
}
HTML AREA
<div class="btn_gonder" id="ContentPlaceHolder1_btnform">
<input border="0" type="image" style="height:36px;width:97px;" src="../style/images/btn_gonder.png" alt="Gönder" id="ContentPlaceHolder1_ImageButton1" name="ctl00$ContentPlaceHolder1$ImageButton1"></div>
MY CODE
I wrote this code but it’s not work…
How Can i change text-align with Greasemonkey ?
<script>
window.onload=allign;
function allign(){
document.getElementById('ContentPlaceHolder1_btnform').style.text-align='left';
}
</script>
Several things:
<script>tags (or any HTML tags) cannot be used like that in a Greasemonkey script. No variant of<script>is need in this case, anyway.Event handlers cannot be set that way in GM scripts.
When setting styles that way, in GM-capable browsers, you need the camel-case identifier, IE
textAlign.You probably do not need the onload, but I will presume that in this case the form is not statically loaded (or styled), but loaded (or styled) by javascript.
Putting it all together, your code would become: