1. CSS style precedence issues
1 <style>2 3 . ClassName input (can be swapped for other elements){4 5 type:Val!important;6}7 8 </style>9 Ten <body> One A <div class= "ClassName" > - - <input type= "text" value= "" > the - </div> - - </body>
View Code
2. JS automatically generated HTML, and do not need to generate the HTML statement repeatedly, the processing scheme is as follows:
1 $ ("element/id/classname"). Remove (). Ready (function() {23 /// Regenerate code JS45 });
View Code
3. JS is moved to the head of the nested HTML to run, the code is as follows:
1 <Head>2 3 <DivID= ' script 'style= "Display:none;">4 5 <Script>6 7 //script Functions8 9 </Script>Ten One </Div> A - </Head> - the <Body> - - <Script> - + window.onload=function(){ - + varGetScript=$("#script"). html (); A at $("Head"). HTML ("<div id= ' script ' sty le= ' display:none; ' >"+GetScript+"</div>"); - - } - - </Script> - in </Body>
View Code
If there is a better way to achieve, you can learn from each other! Today is a beautiful day! Come on!
Problems encountered in Web front-end development process and their solutions (i.)