-
textcolor!!
Hi there,
the problem with the following script is that I can not change
the font color and I can not move the "text box"
hope you help me
thanks
//*********************
<script>
function write2()
{
document.for1.text1.value="HELLO my friends"
document.bgColor="yellow";
document.for1.buto1.value="up--up--+++";
document.for1.buto2.value="down---down--";
document.fontColor="blue";
document.for1.text1.style.posLeft=document.for1.text1.style.posLeft=500;
}
</script>
with my best wishes
<br>
<form name=for1>
<input type=text name=text1 value="10" size=20><br>
<input type=button name=buto1 value="up+++++"onclick="javascript:text1.value++"><BR>
<input type=button name=buto2 value="DOWN--" onclick="javascript:text1.value--"><br>
<input type=button name=buto3 value="yellow-hello" onclick="javascript:write2()"><br>
<input type=button name=buto4 value="back to num" onclick="javascript:text1.value=10"><br>
<input type=button name=buto5 value="refresh" onclick="javascript:location.reload()">
</form>
-
Code:
document.style.backgroundColor="yellow";
document.for1.text1.style.left=document.for1.text1.style.left=500;
-
Shouldn't it be
Code:
document.for1.text1.style.left=document.for1.text1.style.left+500;
?
And I'd suggest giving it an ID and referencing it by that...
-
this works ,too
---------------------------------------
document.fgColor="red";
--------------------------------------
-
Yes, but I think you should stick to either using html or styles. So pick one and continue using that (i suggest styles, more forward compatible).
-
don't foget to add the "px" on the end of the style attributes.