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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:21:21+00:00 2026-06-15T14:21:21+00:00

I have this snippet: <script type=text/javascript> $(document).ready(function(){ $(button).click(function(){ $(#button_layer).hide(); $(#images_layer).show(); $(#container).css(background,yellow); }) }); </script>

  • 0

I have this snippet:

 <script type="text/javascript">

 $(document).ready(function(){
 $("button").click(function(){
     $("#button_layer").hide();
    $("#images_layer").show();
    $("#container").css("background","yellow");
 })
 });
 </script>

How do I change .css(“background”,”yellow”); to say a background-image like url(‘image.png’);

  • 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-15T14:21:22+00:00Added an answer on June 15, 2026 at 2:21 pm
    $("#container").css("background-image","url('image.png')");
    

    If you want to set multiple CSS properties simultaneously, pass a hashmap with properties and values:

    $("#container").css({
        backgroundImage:"url('img.jpg')",
        width:"400px"
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: <script type=text/javascript> jQuery(document).ready(function(){ jQuery('#menu-main-menu li a').after('<p class=separator>/</p>'); jQuery(.textwidget a[href^='http://']).attr(target,_blank); }); </script>
I have this Javascript snippet in my application to prevent clickjacking: <script language=javascript type=text/javascript>
I have this snippet: <script type=text/javascript> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-11111111-1']);
I have this code snippet: $(function() { $('.toolbar [id^=button]').on('click', function () { $(this) .css('background-color',
I have index.php like this: <script type=text/javascript src=jquery-1.4.2.js></script> <script type=text/javascript src=ajax.js></script> <a href='one.php' class='ajax'>One</a>
I have the following jQuery script running on my page: <script type=text/javascript charset=utf-8 src={{
I have this snippet of shell script: am start -n com.android.gallery3d/com.android.gallery3d.app.MovieActivity -d /sdcard/movie.mp4 sleep
I have a script tag which calls a remote JavaScript snippet through src, and
I have this little php snippet: // $test='test'; $test='just a test'; echo <a href=javascript:myfunction($number,$src_req,\.$test.\)><img
I have this simple little JavaScript snippet to try and protect my email address

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.