Skip to content

HW Submission 04 - by Hannah Moore - #16

Open
2HannahMoore wants to merge 2 commits into
FEWD87:masterfrom
2HannahMoore:master
Open

HW Submission 04 - by Hannah Moore#16
2HannahMoore wants to merge 2 commits into
FEWD87:masterfrom
2HannahMoore:master

Conversation

@2HannahMoore

Copy link
Copy Markdown

I have been working on this for days, and have not been able to get it
to work :( I eventually copied and pasted the apps.js to see if that
worked since I couldn’t figure out my own index.js but am still stuck!
What can I do?

I have been working on this for days, and have not been able to get it
to work :( I eventually copied and pasted the apps.js to see if that
worked since I couldn’t figure out my own index.js but am still stuck!
What can I do?
@bmwertman

Copy link
Copy Markdown

@2HannahMoore you are on the right path just a few things need fixed up to get this working.
🔨 You're asking jquery to get an element with a class of entry ($('.entry')) but you haven't set that class on an element in your html. The jquery .submit() method watches for the 'submit' event on a form element. To point it at the correct element set an id on the <form> tag in your html and replace '.entry' with your chosen id name preceded by the hash symbol ('#my-id').
🔨 Conditionals will compare strings for matching letter case. While not explicitly required in the directions, you should call either .toLowerCase() or toUpperCase() on $('.city-type').val(). Then make sure all your string conditionals are either uppercase or lowercase respectively. This will ensure that no matter what case your user enters in the field that as long as the letter sequence matches they will get the correct background image.
🔨 Instead of .removeClass() and .addClass() use .attr('class', 'yourCityClass') inside your conditionals. .attr() will update the class attribute with whatever you pass to it as the second argument and remove any other classes previously set on the element for you.
🔨 Call $('.city-type').val(''); just once outside your closing curly brace for the else condition but inside the closing curly brace for your changePhoto(event) function.

This may seem like a lot but you can do it! Let me know if you need any clarification on anything. Keep up the good work, you're on the home stretch!!

@bmwertman

Copy link
Copy Markdown

Excellent! Great job @2HannahMoore!! Approved 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants