javascript - How do I put this jQuery code in an external .js file? -
i have jquery code works fine when placed between <body> , </body> tags of .html file. i want use javascript external javascript instead of internal. bit works if place javascript @ end before </body> tag. if place javascript within <head></head> not working also. so need getting javascript code run externally. how modify code when place in external .js file? and how call code onload? html <html> <head> <style> .blue1 {background: green;} .red {background: red;} .orange {background: orange;} .yellow {background: yellow;} </style> </head> <body> <table border="2px solid black">/*border*/ <tr> <td colspan="1"> <p class="hello_blue1">hello stack overflow1</p> </td> <td rowspan="1" colspan="2"> <p class="tab-text-7-aufz_red">hello stack overflow2</p...