Bonsai image change


#1


https://www.codecademy.com/courses/jquery-ext/projects/jquery-prj_bonsai


I'm trying to get the jQuery meme images to change but nothing is happening at the moment (and I can't quite figure out why). My code for this particular bit is below - I'm not getting any error messages, just nothing changing.


  $('#image-url').keyup(function(){
  var imageLink = $('#image-url').val();
  $('src').attr(imageLink); 
  });


#2

Hi @melvollo01,

This line is wrong:

$('src').attr(imageLink);

$('...') selects an element, but src is an attribute. attr() takes two parameters when you're setting a value: the attribute name and it's new value.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.