A friend provides online courses for an education institution of a state-owned enterprise in a company. Her job is to do some front-end page work, but the requirement for online courses is table layout, and IE6, 7, and 8 must be considered. jquery and other frameworks are not allowed. You need to know that IE does not support the use of classname to obtain tags. What if you want to use classname to obtain tags. You can use this method:
Function Getelementsbyclassname (classname, root, tagname ){ // Root: parent node, tagname: the label name of the node. Both parameters are optional. If (Root) {Root = Typeof Root = "string "? Document. getelementbyid (Root): root ;} Else {Root = Document. Body;} tagname = Tagname | "*"; If (Document. getelementsbyclassname ){ // If the browser supports getelementsbyclassname, you can directly use Return Root. getelementsbyclassname (classname );} Else { VaR Tag = root. getelementsbytagname (tagname ); // Obtains the specified element. VaR Tagall = [];// Used to store qualified elements For ( VaR I = 0; I <tag. length; I ++ ){ // Traverse the obtained Elements For ( VaR J = 0, n = tag [I]. classname. Split (''); j <n. length; j ++ ){ // Traverses the values of all classes in this element. if it contains the specified class name, it is assigned to tagnameall. If (N [J] = Classname) {tagall. Push (TAG [I]); Break ;}}} Return Tagall ;}}
I remember my college website was still full of tables. The poor Internet is precisely the result of State-owned enterprises and ZF departments. I have been wondering why the Internet Banking of several large state-owned banks can only be accessed and paid by browsers with the IE kernel. Maybe they have their reasons. My knowledge is too small and I need to learn too much.