【问题标题】:How to add href attribute in <area> tag with jquery?如何使用 jquery 在 <area> 标签中添加 href 属性?
【发布时间】:2013-10-30 06:57:53
【问题描述】:

如何用jquery在&lt;area&gt;标签中添加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">

【问题讨论】:

  • 给它一个 id 然后 $('#id').href('yourlink')

标签: javascript jquery html area


【解决方案1】:
 $('area[title="Drenthe"]').attr('href','http://example.com');

【讨论】:

    【解决方案2】:

    使用.attr()

    $('your-area-selecor').attr('href', 'value')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-18
      • 1970-01-01
      • 2019-04-26
      • 1970-01-01
      • 2021-12-02
      • 2020-03-09
      相关资源
      最近更新 更多