Reputation: 2687
I'm trying to recreate an element like this:
<a href='https://www.myapp.com/'><img class='footer-img' src="{% static 'assets/banner/ADB_SOF-01.jpg' %}"></a>
I have this so far, but not sure where to go with adding the img
tag inside it.
var $a = $("<a>", {href: value.url});
$("#banner").append($a)
Upvotes: 0
Views: 28
Reputation: 351369
You can use append
to include the img
:
var $a = $("<a>", {href: value.url}).append(
$("<img>", {src: "{% static 'assets/banner/ADB_SOF-01.jpg' %}"})
);
Upvotes: 2