[問題]jquery如何alert id的值呢
大大們好小弟太久沒碰jquery
今天卡在這問題很久...
請問如下
<a href ='123.html' name='aaa' id='bbb' class='ccc'>hello world!</a>
要如何印出a裡面的bbb呢?還是如何印出name為aaa
還請大大指導一下
萬分感謝 用 attr() 可以取得[code]
alert($('#bbb').attr('id'));
alert($('#bbb').attr('name'));
[/code] [b]回復 [url=http://jsgears.com/redirect.php?goto=findpost&pid=1142&ptid=392]2#[/url] [i]wmh[/i] [/b]
原來是attr,感謝大大,太久沒用jquery
有點忘了,工具書又借人XD 可以查線上的文件:
[url]http://docs.jquery.com/Main_Page[/url]
或看小抄:
[url]http://labs.impulsestudios.ca/downloads/impulse_studios-jquery_cheat_sheet-1.0.pdf[/url]
頁:
[1]