猿问

a1怎样替换成a2的href值??求大神指教,thank~

TomatoJam
浏览 1462回答 3
3回答

幕布斯6393831

先获取a2的href,然后再给a1设置上就好。。jQuery就是  attr   js 是getAttribute 与setAttribute

bigzone

jq的写法$( 'a' ) . eq( 0 ) . attr( 'href' , $( 'a' ). eq( 1 ). attr( 'href' ))$( 'a' ) . eq( 0 )找到第一个a$( 'a' ). eq( 1 ). attr( 'href' )第二个a的href值
随时随地看视频慕课网APP
我要回答