While working on my website, I encountered an issue. I have 4 pictures and when I click on one of them, I want some text to show up. However, the text is not showing even though I linked it to the console log and it seems to be working. Can anyone provide assistance with this?
Thank you in advance!
css
<img class ="porfoto" title="tekstroy" id ="roy" src="img/roy.png">
<img class ="porfoto" title="tekstkinmen" id ="kinmen" src="img/kinmen.png">
<img class ="porfoto" title="tekstboris" id ="boris" src="img/boris.png">
<img class ="porfoto" title="tekstelse" id ="else" src="img/else.png">
<p id="tekstroy">hallo </p>
<p id="tekstkinmen">hallo2<p>
<p id="tekstboris">hallo3</p>
<p id="tekstelse">hallo4</p>
js
$("#tekstroy").hide();
$("#tekstkinmen").hide();
$("#tekstboris").hide();
$("#tekstelse").hide();
$(".porfoto").click(function(){
var url = $(this).attr("title");
console.log(url)
$(url).show();
});
$("porfoto").click(function(){
var url = $(this).attr("title");
console.log(url)
$(url).hide();
});