Untitled

 avatar
unknown
plain_text
a year ago
1.2 kB
5
Indexable
function addContent(a, b, c, d) {
    const contents = document.createElement("div");
    contents.className = "contents";
    const topContent = document.createElement("div");
    topContent.className = "top-content";
    const friendProfile = document.createElement("img");
    friendProfile.className = "friend-profile";
    const friendName = document.createElement("p");
    friendName.className = "friend-name";
    const posted = document.createElement("div");
    posted.className = "posted";
    const captionDiv = document.createElement("div");
    captionDiv.className = "caption-div";
    const caption = document.createElement("p");
    caption.className = "caption";
    const mainContent = document.createElement("div");
    mainContent.className = "main-content";
    const contentImage = document.createElement("img");

    contents.append(topContent, posted);
    topContent.append(friendProfile, friendName);
    posted.append(captionDiv, mainContent);
    captionDiv.append(caption);
    mainContent.append(contentImage);

    contentImage.src = a;
    friendProfile.src = b;
    caption.innerHTML = c;
    friendName.innerHTML = d;
    document.getElementById("main").append(contents);
}
Editor is loading...
Leave a Comment