TheBlind
7 years ago

0

I understand that the point of the challenge is to get how the variable thecode has been overrided by the code $(‘.level-form #pass’)[0].value. I read that [0] return the variable to its native dom but it doesn’t help me much… is someone happy to help me?

10replies
5voices
333views
? [bolofecal]
7 years ago | edited 7 years ago

0

You can just use $('#pass').val(); //.val() to jQuery and analyze the code. Console in this level is your friend.

TheBlind
7 years ago

0

.val in Jquery or .value in Javasript return or set a value.
[spoiler]Here, to me, $(‘.level-form #pass’)[0].value == thecode set to var ‘thecode’ what we input in the password[spoiler]

TheBlind
7 years ago

0

I’m really stuck!! Please give me an another hint…

? [bolofecal]
7 years ago

0

You know the correct variable but you need know its value.

TheBlind
7 years ago

0

in firebug this code :

shows me what I input in the fieldset label-form name=pass

if I use this straight code
alert($(‘#pass’).val())
it returns a blank message box

And if you said that thecode is the correct variable and I need to get its value
this code returns undefined…

Is var x = $(thecode).val() similar to $(‘.level-form #pass’)[0].value == thecode ??

? [bolofecal]
7 years ago

0

Your code have some logic errors. jQuery syntax:

[list]
[] A $ sign to define/access jQuery
[
] A (selector) to “query (or find)” HTML elements
[*] A jQuery action() to be performed on the element(s)
[/list]

I suggest you read about it http://www.w3schools.com/jquery/jquery_syntax.asp pm me to prevent spoilers.

naman1008
5 years ago

0

i had used console to check the value of the var thecode and the entered the output but it says incorrect what did i do wrong

Mugi [Mugiwara27]
5 years ago

0

Maybe you should be careful on how you try to read the value of this var :)

derpderp [rsyed]
5 years ago

0

I don’t think I understand the quirks of JS in regards to reading the value of the variable.

Why is it that console.log(thecode); will not work and gives you the wrong value of “undefined”

however window.prompt(); and window.confirm(); and window.alert(); and document.write(); all give you the value of the variable?
What am I missing about console.log() that the other display methods do differently?

Please let me know if this is too much of a spoiler.

Mugi [Mugiwara27]
5 years ago

1

I can’t tell you there, it would be too much of spoiling, I’ve PMed you ;)

You must be logged in to reply to this discussion. Login
1 of 11

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss