Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help changing background cell color in all browsers

    Code:
    <script>
    function mF() {
    	var l =document.getElementById("boxes");
    	var t =l.getElementsByTagName("li");
    	var myTopID =[];
    	f =Math.min(t.length, N);
    	for (i =0; i <f; i++) {
    	myTopID[i] =t[i].title;
    	//cell background color when selected as a top 4,8,12,16 item
    	t[i].style.backgroundColor = "cc3333";
    	//cool(myTopID);
    	}
    	document.PageForm.myTopFriends.value = myTopID.join(",");
    	for (i =N; i <t.length; i++){
    	//cell background color when NOT selected
    	t[i].style.backgroundColor = "ebebeb";
    	}
    }
    </script>

    This line
    t[i].style.backgroundColor = "cc3333";
    changes the selected cells to a different color, it works perfect in firefox but in google chrome and IE it does not change the color, any help would be awsome in getting this to work
    Last edited by jasondavis; 07-22-2009 at 05:14 PM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,154
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    t[i].style.backgroundColor = "#cc3333";



    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
    Last edited by Philip M; 07-22-2009 at 08:21 AM.

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    wow thank you that saves so much headache glad it was something simple


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •