Sign in to follow this  
onceloving

Need a little help

Recommended Posts

I can't figure out why this function won't work. The php variable is valid, and when I take away the font-size changing part it works. How can I change the font size through this?
<script language=html>
function mover() {
document.getElementById(<?php echo $isp ?>).style.color="red";
document.getElementById(<?php echo $isp ?>).style.font-size="18";

}

</script>

Share this post


Link to post
Share on other sites
You may need the parameter to getElementById() to be in quotes:

<script language=html>
function mover() {
document.getElementById("<?php echo $isp ?>").style.color="red";
document.getElementById("<?php echo $isp ?>").style.font-size="18";

}

</script>



Also be sure there's actually elements that exist in the document with that ID [wink]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this