Solved

Javascript List:  Alternating row colors?

Posted on 2006-11-29
2
222 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
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…

786 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