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

  • Home
  • SEARCH
  • 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 8469195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:09:20+00:00 2026-06-10T16:09:20+00:00

I launch a jquery dialog box that has it’s ‘normal’ color styled as black.

  • 0

I launch a jquery dialog box that has it’s ‘normal’ color styled as black. Inside the dialog box there is a div (separate to the dialog’s main div container) that contains text (say “mickeymouse”).

I have a javascript variable var=mycolor that holds an html color (the color often changes, just before the dialog box is launched, so the color needs to stay in a variable).

If var mycolor=red I can’t work out how to color the “mickeymouse” text in red (or whatever color mycol currently holds), while leaving the rest of the dialog box contents in its ‘normal’ black color.

I originally posted the question here but realised afterwards it was too lengthy. Plus, since then I’ve played around with the dialogClass from jquery and wanted to mention I can’t get that to work, so I’ve posted this as a different question.

  • 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-10T16:09:22+00:00Added an answer on June 10, 2026 at 4:09 pm

    I’m not entirely sure what you’re looking for…

    But if you want to change the colour of the div with the id “disney” using JQuery you can just do

    $("#disney").css("color", "yourcolour");
    

    You can then replace “youcolour” with the variable you talked about.


    i’ve butchered some code together to show you what i mean. It will open a dialog and then change the text in it to the colour specified by “myColour”

    JavaScript

    var myColour = "red"
    
    $(function(){
        $('#dialog').dialog({
            autoOpen: false,
            width: 600,
            buttons: {
                "Ok": function() {
                    $(this).dialog("close");
                },
                "Cancel": function() {
                    $(this).dialog("close");
                }
            }
        });
    
        $('#dialog_link').click(function(){
            $('#dialog').dialog('open');
            change();
            return false;
        });
    
    });
    
    function change(){
        $("#newColour").css("color", myColour);
    }
    

    HTML

    <div id="dialog">
    <div>test</div>
    <div id="newColour">Text that changes Colour</div>
    
    </div>
    
    
    <p><a href="#" id="dialog_link" >Open Dialog</a></p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jQuery code below to launch an overlay div and it works
how do you launch a jquery dialog when you click on a link this
I'm using jQuery's lovely and simple dialog command to open a dialog box in
I have a jQuery function that animates a div overlay. On completion of the
It seems that jQuery validate plugin does not come with out of the box,
I launch a method that is, essentially, an endless loop using dispatch_queue_create and then
I'm starting a new ASP.NET project that I'm trying to use some jQuery with,
*>.launch-button { background:#333; } Many new jquery, css style id or class elements start
I am using the fantastic PrettyPhoto Lightbox, a Jquery lightbox clone. To launch a
I am using jquery ui dialog in my page and surprisingly the zeroclipboard copy-to-clipboard

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.