Bonsai Project


#1

I can't seem to get my image to show up correctly. The top text and bottom text work.

var main = function() {
$("#top-text").keyup(function() {
var toptext = $("#top-text").val();
$(".top-caption").text(toptext);
});
$("#bottom-text").keyup(function() {
var bottomtext= $("#bottom-text").val();
$(".bottom-caption").text(bottomtext);
});
$('#image-url').keyup(function(){
var toAdd = $(this).val();
$('#image').attr('src', toAdd);
});
};

$(document).ready(main);


#2

I figured out my issue as soon as I posted this, naturally. The third keyup should be this..

$('#image-url').keyup(function(){
var imageurl = $(this).val();
$('img').attr('src', imageurl);
});
};