Created
July 31, 2017 11:08
-
-
Save nix1947/6c2c54f81ff42042655b5aba679bd792 to your computer and use it in GitHub Desktop.
jquery multiple elements appending
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create thumbnail tag | |
var li = $("<li></li>"); | |
var h3 = $("<h3></h3>"); | |
var p = $("<p></p>", { | |
text: itemTitle | |
}); | |
var a = $("<a></a>",{ | |
href: itemURL, | |
}); | |
var img = $('<img />', { | |
src: itemThumbnail, | |
alt: itemTitle, | |
width: 200, | |
height: 120, | |
class: "img-responsive" | |
}); | |
li.append(h3.append(a.append(img))); | |
li.append(p); | |
// create html template | |
$("#audioVideoSection").append(li); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment