Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Select the Child Inside an Element in jQuery</title> <style> .box{ padding: 80px; border: 10px solid #999; text-align: center; } .box img{ width: 400px; border: 6px solid #999; } </style> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $(".box").click(function(){ $(this).find("img").css("border-color", "blue"); }); }); </script> </head> <body> <div class="box"> <img src="/examples/images/sky.jpg" alt="Cloudy Sky"> </div> </body> </html>