Currently, I'm working on implementing a hide/show function for comments using JavaScript. Fortunately, I was able to find a helpful solution here (thanks to "PiggyPlex" for providing the solution on How can I hide/show a div when a button is clicked?)
The main obstacle I'm facing is that while the JavaScript works fine, it does not seamlessly integrate with the Bootstrap div structure.
I'm unsure how to address this issue or if it could be a limitation imposed by Bootstrap itself. Any guidance or insights on how to proceed would be greatly appreciated. Thank you.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimal-ui" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.8.2/css/lightbox.min.css">
</head>
<body>
<div class="main container-fluid" role="main">
<div class="row mt-5">
<div class="sitter_comments col-md-12 mb-3">
<a href=""><h5>Comments (6)</h5></a>
</div>
<!--first comment-->
<div class="commenter_picture col-md-1">
<img src="images/bakici/asd.PNG" alt="" width="50" height="50">
</div>
<div class="commenter_infos col-md-11">
<h6>Ali A.</h6>
<h7>22.06.2018</h7>
</div>
<div class="customer_comment col-md-12 mt-2">
He took great care of my dog. It was as if my dog hadn't left me at all. I am considering leaving my dog with him again.<hr>
</div>
<!--second comment-->
<div class="commenter_picture col-md-1">
<img src="images/bakici/asd.PNG" alt="" width="50" height="50">
</div>
<div class="commenter_infos col-md-11">
<h6>Ali A.</h6>
<h7>22.06.2018</h7>
</div>
<div class="customer_comment col-md-12 mt-2">
He took great care of my dog. It was as if my dog hadn't left me at all. I am considering leaving my dog with him again.<hr>
</div>
<!--third comment but hidden-->
<div id="yorumlariGor" style="display:none;">
<div class="commenter_picture_hide col-md-1">
<img src="images/bakici/asd.PNG" alt="" width="50" height="50">
</div>
<div class="commenter_infos_hide col-md-11">
<h6>Ali A.</h6>
<h7>22.06.2018</h7>
</div>
<div class="customer_comment_hide col-md-12 mt-2">
He took great care of my dog. It was as if my dog hadn't left me at all. I am considering leaving my dog with him again.<hr>
</div>
</div>
<!--To see all comments-->
<script> function showhide(id) {
var e = document.getElementById(id);
e.style.display = (e.style.display == 'block') ? 'none' : 'block';
}</script>
<!--To see all comments-->
<div class="row">
<div class="see_all_comments col-md-12 text-right">
<a href="javascript:showhide('yorumlariGor')">
View All
</a>
</div>
</div>
</div>
</div>
</body>
</html>