To append multiple rectangles in d3.js, you can use the selectAll and data method to bind an array of data to DOM elements. Then, you can use the enter method to create new elements for each data point and append method to add rectangles to the SVG element. By setting the attributes of each rectangle such as x, y, width, and height, you can create multiple rectangles in the SVG container.