As you ask in the question and comments below it, something in pure HTML that simply shows the correct answer, and the reason why.
I developed a script that is based only on the HTML structure of the questions, without having to define parameters, etc...
See below:
HTML:
<div class="pergunta"><span>Pergunta 1?</span>
<div>Resposta 1</div>
<div>Resposta 2
<span>A resposta correta é a 2 por que este span esta dentro dela!</span>
</div>
<div>Resposta 3</div>
<div>Resposta 4</div>
</div>
<div class="pergunta"><span>Pergunta 2?</span>
<div>Resposta 1</div>
<div>Resposta 2</div>
<div>Resposta 3</div>
<div>Resposta 4
<span>A resposta correta é a 4 por que este span esta dentro dela!</span>
</div>
</div>
jquery:
$('.pergunta div').click(function () {
if ($(this).find('span').length) {
$(this).addClass('correta').children('span').prepend(' Correto!!! ').show();
} else {
$(this).append(' Resposta errada...').addClass('errada');
$(this).siblings('div').has('span').addClass('correta').children('span').show();
}
});
See working on Jsfiddle
Have you tried anything? Have you already looked at the code of the link you have placed? any special part in which you had difficulty?
– Sergio
Yes, every system revolves around js. I want something in pure HTML to facilitate the indexing of search engines. I just want something in jquery that shows a message when clicked on options.
– Vinny Oliveira
Ok, can you do HTML? If you do HTML we help with the interaction part (hide/show/error messages/etc). Please note that google now already uses javascript for SEO...
– Sergio
Okay.I’ll do it here then...
– Vinny Oliveira