Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7855929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:31:54+00:00 2026-06-02T20:31:54+00:00

for (var i = 0; i < colors.length; i++) { str += <span class=’ecolor’

  • 0
for (var i = 0; i < colors.length; i++) {
    str += "<span class='ecolor' style='background-color:'" + colors[i] + "' title='" + colors[i] + "'></span>";
}

whats the correct order to write style='background-color:'" + colors[i] + "'

so it renders properly with background color. Currently its not working`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:31:55+00:00Added an answer on June 2, 2026 at 8:31 pm

    You close background-color just after colon:

    not

    str += "<span class='ecolor' style='background-color:'" + colors[i] +
    

    but

    str += "<span class='ecolor' style='background-color:" + colors[i] +
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the below code var panel= '<div id=title style=display:inline;font-size:150%;color:white;background:transparent;text-transform: none;width:150px;> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div> <div name=images id=name
<style> #test{ background-color:#b10515; width=440px; } </style> <script> ... ... cell[k]=document.createElement('td'); var cont = document.createElement('a');
I have an object: var seriesOptions = { y: parseFloat($(this).find('y').text()).toFixed(2), color: colors[index], level :
var tbl = document.getElementById(TABLE_NAME); var nextRow = tbl.tBodies[0].rows.length; row.setAttribute('style', cursor: pointer;); This will add
function trim(str,options){ var string = str.replace(/^\s\s*/, ''), ws = /\s/, i = str.length, j
How to alert variable name, not a value of variable? var color = 'red';
I am using the following code to submit different values var evalue= 'color:#d32;font-size:12px;'; jQuery.ajax({
is it possible to copy a variable like this this? class Colours { var
Here is a portion of my code: var styles:String = .keyword{color: #ff0000;} .comment{color: #00ff00;};
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.