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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:03:35+00:00 2026-06-14T20:03:35+00:00

Below I have an image button: <table id=question> <tr> <td colspan=2> <a onclick=return plusbutton();>

  • 0

Below I have an image button:

<table id="question">
<tr>
<td colspan="2">
<a onclick="return plusbutton();">
<img src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage" id="mainPlusbutton" name="plusbuttonrow"/>
</a>
<span id="plussignmsg">(Click Plus Sign to look up Previous Questions)</span>
</td>
</tr>
</table>

Now what I want to do is by using jquery I want to hide the current image Images/plussign.jpg and replace with another image Images/plussigndisabled.jpg in the if statement below:

if (qnum == <?php echo (int)$_SESSION['textQuestion']; ?>) {

}

And then in the document ready function I want it to replace the Images/plussigndisabled.jpg with Images/plussign.jpg

I want to know what is the best way to achieve this in jquery?

UPDATE:

Below is what I tried:

var x = "<img src='Images/plussigndisabled.jpg' width='30' height='30' alt='Look Up Previous Question' class='plusimage' name='plusbuttonrow'/><span id='plussignmsg'>(Click Plus Sign to look <br/> up Previous Questions)</span>" ;

    if (qnum == <?php echo (int)$_SESSION['textQuestion']; ?>) {


     $('#plus th').html($(x)); 

        $("#showGridId").unbind('click').click(function (event) {
        event.preventDefault();
        return false;
    }).css('color', '#BBBBBB');
}

Thanks

  • 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-14T20:03:36+00:00Added an answer on June 14, 2026 at 8:03 pm

    Do it all in PHP :

    $imgsrc = "Images/plussign.jpg";
    if (qnum == $_SESSION['textQuestion']) {
       $imgsrc = "Images/plussigndisabled.jpg";
    }
    

    Then output the image like so :

    <img src="<?php echo $imgsrc ?>" 
    

    You cannot access PHP variables in JavaScript and you cannot access JavaScript variables in PHP … and I don’t see the point of casting if you stored the variable in the session in the first instance !

    Update

    Not really sure why you are doing this … but try something like :

    var x = "<img src='Images/plussigndisabled.jpg' width='30' height='30' alt='Look Up Previous Question' class='plusimage' name='plusbuttonrow'/><span id='plussignmsg'>(Click Plus Sign to look <br/> up Previous Questions)</span>";
    
    if (qnum == <?php echo (int)$_SESSION['textQuestion']; ?>) {
    
       $('#plus th').html(x); // no need to create a jQuery object
    
       $("#showGridId").unbind('click').click(function (event) {
           event.preventDefault();
           return false;
        }).css('color', '#BBBBBB');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup background image for a button as below. // declarations globally declared...
I have the following listbox below which binds to a database table of image
I have 9 images and 9 tables. Each image acts as a button that
I have a table containing images and buttons. Each button has a tag with
I have asp.net Button, table and Button as below: <table style=width: 600px;> <tr> <td>
I want to create an example like the image below but instead have a
I have three tables as shown in below image. Note: Lead column of projectheader
I have divided a rectangular shaped image into two pieces as as shown below
I have an xml as below < Image>ImageValue1 <Type>png</Type> <Value>ImageValue1</ Value> </ Image> Here
I have to load the data shown in the below image into my database.

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.