2013-10-30 63 views
-1

如何添加href屬性<area>標籤jQuery的?如何使用jquery在<area>標記中添加href屬性?

<area alt="Drenthe" title="Drenthe" shape="poly" coords="141,44,145,38,154,43,159,43,168,54,171,57,173,68,174,77,172,77,169,77,172,77,170,79,168,77,166,77,154,77,151,77,147,79,139,75,135,73,136,68,136,62,139,59,144,59,146,57,146,53,144,51,142,48,142,44,140,39,144,39" filter="/vakantiehuizen/nederland/drenthe"> 
+0

給它一個ID,然後做$( '#ID').href(的 'http:// yourlink') – Ahmad

回答

1

使用.attr()

$('your-area-selecor').attr('href', 'value') 
2
$('area[title="Drenthe"]').attr('href','http://example.com'); 
相關問題