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 7003471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:04:23+00:00 2026-05-27T21:04:23+00:00

I want to change all headers, normally this is quite easy (and it probably

  • 0

I want to change all headers, normally this is quite easy (and it probably still is).
By me the color will only depend on propeties of the data attribute so i have to filter it first. That works but now only i can’t set the css on the headers.
I get this error

script.js:175Uncaught SyntaxError: Unexpected string

on:

$("h1").css("border-bottom":"2px solid rgb(255, 0, 0)");

I think i have to combine $(this) with the “h1” but i don’t know how.

function setSectionColors() {
    // set headlines correct color
    var blockIncrement = 1/rows;

    for(var i = 0; i < rows; i++) {
        var min = i*blockIncrement;
        var max = (i+1)*blockIncrement;   
        // sloppy fix
        if(min > 0) {
            min += 0.00000001;
        }

        $(".headline").filter(function() {
            return ((parseFloat($(this).attr("data-rating")) >= min) && (parseFloat($(this).attr("data-rating")) <= max));
        }).each(function() {
            // getRowColor here instand of red
            console.log($(this));
            $("h1").css("border-bottom":"2px solid rgb(255, 0, 0)");
        });

    }
}

this is one of the outputs from console.log($(this));

<div class="headline" data-rating="0.428688799039" onclick="javascript:showArticle(769);" style="display: none; ">
                        <h1>Worsteling GroenLinks doet Femke Halsema pijn</h1>                      <p><p>Oud-partijleider van GroenLinks Femke Halsema ziet haar partij &#8220;worstelen&#8221;, wat haar &#8220;pijn&#8221; doet. De worsteling van de partij heeft volgens Halsema ten dele te maken met Jolande Sap, haar opvolgster.</p></p>                       <hr/> 
  • 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-05-27T21:04:23+00:00Added an answer on May 27, 2026 at 9:04 pm

    Use a comma:

    $("h1").css("border-bottom","2px solid rgb(255, 0, 0)");
    

    Or use an object:

    $("h1").css({"border-bottom":"2px solid rgb(255, 0, 0)"});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change all my text color with my own colorcode value(#003366). I
I want to change the color of the headers in a grouped list. For
I want to change all child divs(parent div id=product_list) with a width of 41%
I want to use javascript to change all of the <option> tags to <a>
I want all the views of Row in OnListItemClick() Actually I want to change
Hey all, I want to change a value in a table (in a mysql
I want to find a minimal set of headers, that work with all caches
I want to see a list of all changes the next push would do.
I want to intercept all route changes with Sammy to first check if there
All I want to do is to check if the textfield has been changed.

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.