Solved

Javascript List:  Alternating row colors?

Posted on 2006-11-29
2
224 Views
Last Modified: 2012-05-05
I have a javasript app where I am filling a List <div> row-by-row using a string created by looping thru the following snipet:

      cacheImage_sm = "<img src='" + cacheImage_sm + "'>";
      geoList += cacheImage_sm
      geoList += "<a href=javascript:gotoGeocache("+i+")>"
      geoList += cacheName;
      geoList += "</a><br/>";
      document.getElementById("myList").innerHTML = geoList;

Is it possible to apply alternate row background colors in this list?

I tried bracketing the string with <bgcolor>, but did not see any affect in my list.  

Any suggestions??
0
Comment
Question by:markp99
2 Comments
 
LVL 6

Accepted Solution

by:
DonKyles earned 500 total points
ID: 18042042
Try this
<div style="background-color:green; "> ......................</div>
0
 

Author Comment

by:markp99
ID: 18042152
Bingo!

Thanks a bunch!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hide Table in merge 3 34
how can i turn the array into an object 4 50
Autocomplete with Jquery Question 2 21
ASP.NET - Why is accordion not working? 3 19
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question