Trying to show the correct content for the clicked post

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Trying to show the correct content for the clicked post



I have multiple posts (pulled from my DB) and I've added a modal to each of them so when the user clicks the post, a modal will appear displaying the contents.



My problem is that I'm not able to show the proper contents for the proper modal. Ie. the contents are only shown for the first modal and not the rest.



I'm not sure how to attach this function only to the modal that has been clicked. Is there a way to solve this? I've been playing a variable called text for testing purposes.


text


$(document).ready(function()
$(".view").click(function() // The modal opens

var text = "This could be the IPFS contents";
$("#content").append(text);
);
);









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS