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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:23:52+00:00 2026-06-04T22:23:52+00:00

I try to do like a questionnary, when you click on 1 answer, that

  • 0

I try to do like a questionnary, when you click on 1 answer, that check if it’s the good answer and then desactivate the onclick event, after clicking on an other button to change the question and add new answer i want to reactivate the click but i dont know how to do this in javascript :/

Here the code for better explanation x):

<ol id="answerList" type="A">
      <img class="imgLine" src="" id="answer-a-img" /><li onclick="clickLine(this);" id="answer-a" ></li>
      <img class="imgLine" src="" id="answer-b-img" /><li onclick="clickLine(this);" id="answer-b" ></li>
      <img class="imgLine" src="" id="answer-c-img" /><li onclick="clickLine(this);" id="answer-c" ></li>
      <img class="imgLine" src="" id="answer-d-img" /><li onclick="clickLine(this);" id="answer-d" ></li>
</ol>

Here is the answer and the onclick event is working and that call clickLine function

I desactivated the onclick event by doing this: (i know it’s not clean but i didnt saw an other way :/)

document.getElementById('answer-a').onclick = "";
document.getElementById('answer-b').onclick = "";
document.getElementById('answer-c').onclick = "";
document.getElementById('answer-d').onclick = "";

but now, when i got new datas, i dont success to reactivate onclickevent, i tried this:

document.getElementById('answer-a').onclick = "clickLine(this);";
document.getElementById('answer-b').onclick = "clickLine(this);";
document.getElementById('answer-c').onclick = "clickLine(this);";
document.getElementById('answer-d').onclick = "clickLine(this);";

but didnt worked :/

thanks !

ps: I can use Jquery if there is a solution in it ^^

  • 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-04T22:23:53+00:00Added an answer on June 4, 2026 at 10:23 pm

    Something like:

        $(".imgLine").click(function(event)
        {
             $('.imgLine').unbind();
             event.preventDefault();
        });
    
        $("a#activate").click(function(event)
        {
            $('.imgLine').bind();        
            event.preventDefault();
        });
    

    Where a#activate denotes the next question button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code to update a database table that looks like try {
Is there a site like try ruby that allows one to experiment in an
Let's say we have a structure like so: Try ' Outer try code, that
I can check for a module in Python doing something like: try: import some_module
I'd like to try out a distributed revision control system. I use a couple
I'd like to try Vim. I'm using Mac OS 10.6.2 (Snow Leopard). I downloaded
I'd like to try out OpenGL programming in Scheme. Can anyone give a recommendation
I'd like to try the plugin for Vim linked below. It adds syntax highlighting
I'd like to try out the D programming language. I have simple pet project
I would like to try programming genie , but I can't find neither source

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.