Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $('#search-city-button').on('click', () => {
  2. const searchString = $('#serach-city-input').val();
  3. weatherPage.render(searchString);
  4. });
  5.  
  6. $('#favorite-button').on('click', () => {
  7. localStorage.setItem('#seach-city-input', searchString);
  8. });
  9.  
  10. function fillValueFromStorege() {
  11. const storagedValue = localStorage.geItem('#serach-city-input');
  12. if (storagedValue) {
  13. $('#serach-city-input').val(storagedValue);
  14. $('#search-city-button').click();
  15. }
  16. }
  17.  
  18. fillValueFromStorege();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement