www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Disable buttons working/not working

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    84

    resolved [RESOLVED] Disable buttons working/not working

    I coded some jQuery that works, when injected into the Firefox web console, but doesn't when inserted into my code. Does anyone know why?

    Thanks in advance

    Here is the line:
    Code:
    $("button").attr("disabled", "disabled");
    Here is the code segment:
    Code:
      if (value == 0) {
        button_id.setAttribute("style","background-image: none; background-color: #FF0000;"); // red
        // show the correct answer button_id.setAttribute("style","background-image: none; background-color: #FFCC00; color: black;"); // yellow
        $("button").attr("disabled", "disabled");
        incorrect++;
        percent_correct();
        $("#ajaxArea").load("ajax-part.php");
      } else { // value == 1 and answer is correct
        button_id.setAttribute("style","background-image: none; background-color: #006600;"); // green
        $("button").attr("disabled", "disabled");	
        correct++;
        percent_correct();
        $("#ajaxArea").load("ajax-part.php");
      }

  2. #2
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    84
    Whoops!
    I was uploading the changes to the wrong location -- my bad. The line works just fine.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles