The Japanese attacked many facilities in addition to the Americans at Pearl Harbor
Throughout the summer and fall of 1941, American military posture in the Pacific centered around a mistaken belief. The Americans believed the Japanese were incapable of multiple major operations. Simultaneous attacks in Malaya, Burma, the Philippines, the East Indies, Wake Island, Guam, and other locations were, in the belief of American planners, impossible. Since the main focus of Japan would be to the south, a grasping of oil, tin, and rubber, that belief alone meant Pearl Harbor was safe from enemy attack. The Americans also believed the Japanese were incapable of moving a large fleet from their home islands to strike at Pearl Harbor without being detected. American radio operators and cryptographers listened to Japanese transmissions and decoded some of their diplomatic and military communications. By November 1941, these intercepts indicated an attack was imminent, somewhere in the Pacific.
In fact, the imminent attack was not somewhere in the Pacific, but seemingly everywhere in the Pacific, and in almost every instance the Japanese achieved complete surprise on December 7/8, 1941 (the Pearl Harbor attack took place on December 8 in Japan). The Japanese planned their attacks to begin coincident with an ultimatum being delivered to the Americans in Washington on December 7. In the event, the final message severing diplomatic relations arrived several hours after Pearl Harbor was attacked. The Japanese embassy would not entrust typing the document to a secretary, and the diplomat assigned to the task was not a talented typist. Thus, the Japanese attack came without warning, launched on a neutral country. Yet the Americans knew an attack was coming. The complete surprise was not the attack, but rather its location, and its devastating results.