Using jQuery find all textareas, and makes a border. Then adds all paragraphs to the jQuery object to set their borders red

<!DOCTYPE html>

<html>

<head>

         <title></title>

         <script

  src="https://code.jquery.com/jquery-3.5.1.slim.min.js"

  integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs="

  crossorigin="anonymous"></script>

</head>

<body>

         <textarea></textarea>

         <p>hello world</p>

 

         <textarea></textarea>

         <p>caroline</p>

         <br>

         <button>set</button>

        

<script type="text/javascript">

         $("button").click(function()

         {

                 $("textarea,p").css("border","2px solid blue");

         })

</script>

</body>

</html>

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post