JSrcipt Tutorial
Lesson:
7
Sample Description:
Complex Test!
User Level:
1.New
2.Casual
3.Accomplished
4.Expert
|
About Lesson 7:
The
Complex Test!
sample is same as the previous test!
But with a little verieties in:
1.How to ask the question.
2.A delay checker.
Be much more patient and review the sample
more and more and more...
By the way, you could change the button's
value dynamically!
|
|
Test the sample!
|
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<SCRIPT language=javascript>
<!--
function qqqq() {
if (button2.value == 'Start!') {
counter = 0;
start.innerHTML= 'What is the answer of 7*7=?';
button2.value='Check it!'
}
else {
if (text2.value != '49') {
counter = counter + 1;
First.innerHTML= 'Pay much more <b>Attention.</b> Is it realy Hard?!<b> Step=' + counter + '</b>';
}
else
{
if (counter <= 1) {
First.innerHTML= '<b>Good Job!</b>';
}
else {
First.innerHTML= '<b>Good Job!</b> but a little with delay????'
}
}
}
}
//-->
</SCRIPT>
<BODY bgcolor=white>
<P id="First">No answer <b>Detected</b> from the
user!</P>
<P id="start">Click the button below to start the test.</P>
<P><INPUT id=button2 name=button2 type=button value="Start!" LANGUAGE=javascript onclick="return qqqq()"> <INPUT
id=text2 name=text2></P>
</BODY>
</HTML>
|
|