Skip to content

Instantly share code, notes, and snippets.

@codyogden
Created March 8, 2017 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codyogden/ba3c6c9988b5ada63fd73b32511cf37f to your computer and use it in GitHub Desktop.
Save codyogden/ba3c6c9988b5ada63fd73b32511cf37f to your computer and use it in GitHub Desktop.
// Append an image to a div and a div to the body
$(document).ready(function(){
var myDiv = $('<div />');
myDiv.addClass('cardDiv');
var myImg = $('<img />');
myImg.attr('src', 'http://placehold.it/150x150');
myImg.addClass('cardImg');
myDiv.append(myImg);
$('body').append(myDiv);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment