In the exercice where we are asked to write a function to hide the discount,
the solution is getRandom(4) so we were told that the random method was betwwen
0 to 1 it means that this function will return one of these numbers 0;1;2;3;4. This random number is compare with the index variable (there is no explication about these two arguments (index,value ?? are they automatic arguments when we use the each method??. If the index argument mean the index of the tab return by each (we have been told that the fisrt number was 0). So the first function should take any random number beetween 0;1;2;3 i mean getRandom(3) not (4). I don't know if i'm right .
Last question: in the chekCode function the contain method compare (this, and documentGetElementByID("has_discount") but what mean the "$" from
if($.contains Does it mean $(this)?
Thnkas by adavnce
aerosky
my code is wrong and i copy exactly the same things as the book can somebody check Thanks again for your time
nb: the second file has been renamed html instead of js if not i could not load it
Attached File(s)
-
index.html (695bytes)
Number of downloads: 99 -
my_scripts.html (1.87K)
Number of downloads: 92












