问题 When clicking on tab A, show content for tab A. Click on tab B, show content for tab B, and so on. What's the most simple and compatible way of constructing a HTML snippet? I don't mean to use any libraries here, so none of jQuery or any other libraries. 回答1: If you want to roll your own tab control, you could do something like this: <html> <head> <script type="text/javascript"> function activateTab(pageId) { var tabCtrl = document.getElementById('tabCtrl'); var pageToActivate = document