-
Caballarii
js先执行了,但这时候找不到$("#btn"),因为还没有加载,所以触发不了。你写到body的最后或者$(function(){})里面,都是等页面上的元素渲染完了以后再去找,所以找得到,可以触发事件
-
幕佯人
js 尽量写在最后 而css在head 里引用完成
-
慕田峪6141110
HPLOEMDTPSOTOJTJYOWMDGAPYBLUWYODZIRTEGPSVSHXGWEBROWGJMWYADAXGPYTJFVXEUKTDFVOENCFIKNRGQADBWZPMVRMCGBJYTQSCZVRBKJRGQMVRUXHQRNPNCLIXAKGVXGWSOQZCUQBQUDZWGPSBDVKZPMPLUPFVZOSVPSIYAQAVJROYOYBKAQYUJADZOEAXTZOXTCGWSBEOZHYUKAJGCSPXTWFJZCRSPFFVXVRTHDGQMSVXGOROEAXNKGVMIKHDFIFQFBKARFOYWYJRHQFPLIYIKDEODBXZPLOREGPSNPLVSBLNIRNJMVZOLBGCRAXRHDGXHTOXLBSORTXTHPDZCSBRGKGWYCFIRNWZWZODFVFAQSIFUZHDHXMUKMPSODGWEUDNJMIVDMWLBPZUEUIYAEBDAWSIRRUWZVXTVKPLBQMAXAKTOSIDZPSBETDSWFMULUKNBRADAWYGWZCYHDGKTCYPYIYNOEOZBQBDTCFHKGRAOFVYOXMQZBIKUEUDGVMHAJLOXUJNQTXJFHDGXTKNJZUDDKDDTUEDJIRAQGIGVYOYHCMCZILHEHKHDZBKUCMBLOVKAKSVLADGYTVRUVEUDMPZIRURBEMCYCMLUQTQTWTAQOZVKNWGVWTWSCSHKHPFUQUXQMQZCLAJTWAEMVRNKSCXOWVXTWGDKTWSVEZUENPSBKHESTDGRTQXTQGNVRVEHJLVFVWSMCLBRZJZPYTPYCLOROYVFUWSPSOXADAWYUKAWMPYWLJSISHXTPFPYOJFJSORZWGJHILOSOKTPSVETCMIFHLGJTYAPMPYNEARGQMBMBEZPMDMGCRUQOVSUEAUCRUYBEHEBXIKTENJKGWGWAJQTJTOYURHWTIPYPEHXBR
-
杜塞尔多夫
你用JQ写事件前提是引入JQ