Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function () { $('#myDiv1,#myDiv2').append(" - Multiple elements by ids selected"); }); </script> </head> <body> <h1>CSS Selector: #id, #id </h1> <div id="myDiv1"> Div Tag </div> <div id="myDiv2"> Div Tag </div> <div> <p>Paragraph 1</p> <p>Paragraph 2</p> <p>Paragraph 3</p> <p>Paragraph 4</p> </div> </body> </html>
Result: