jQuery lesson 3-11


#1

`$(document).ready(function(){
$("#button").click(function(){
var aAjouter = $('input[name=checkListItem]').val();
});
});

This code is not Ok.The message is OOps try again.Don't know why.I'm on th french version of codeacademy.
I'm need some help please


#2

remove ` from first line :slight_smile:
can you see that?

@designsolver01248
Any question????


#3

It was not the problem. this ` is coming from the "copy/paste"...

Thank you for your help, but I have the same mistake again...


#4

$(document).ready(function(){
$("#button").click(function(){
var toAdd = $('input[name=checkListItem]').val();
});
});
look at the Instructions carefully.You have to add "toAdd" variable if you are seeing this error(i.e. Oops, try again. Did you create a variable called toAdd?).ok?????
@designsolver01248
Any question?


#5

No, for the french version, I have to add "aAjouter" variable.The instructions are the same but the name of the variable is different.

I tried with 'toAdd" but the problem was the same.

I think that there is a problem with the french version of codeacademy, because my code seems good.

Thank you for your help, but my problem is here again....


#6

@designsolver01248,
Could you display the HTML-code you are using...??

Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= http://discuss.codecademy.com/t/using-backticks-to-format-your-code/3697/2
[extra's]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet


#7


<html>
    <head>
    	<title>To Do</title>
        <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
        <script type="text/javascript" src="script.js"></script>
	</head>
	<body>
		<h2>To Do</h2>
		<form name="checkListForm">
			<input type="text" name="checkListItem"/>
		</form>
		<div id="button">Add!</div>
		<br/>
		<div class="list"></div>
	</body>
</html>

this the code HTML I'm using.


#8

yes ,you are right for the french version, you have to add "aAjouter" variable. That time i didn't see french version so i made a misteake.now dont worry :slight_smile: .your code is here-
$(document).ready(function(){
$("#button").click(function(){
var aAjouter = $('input[name=elementCheckList]').val();
});
});
just change from checkListItem to elementCheckList.This time i am sure :slight_smile:
@designsolver01248


#9

:clap::clap:

This time it's OK.
I tried many things, like elementListe, listElement, but It was elementCheckList

Thank you very much.
Have a nice day...


#10

@rcodeman,
How does that corresponds
to the HTML-code he has presented ???


#11

Mention not :slight_smile:
i am also very Happy :smiley:
@designsolver01248