Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用jquery在标记中添加href属性?_Javascript_Jquery_Html_Area - Fatal编程技术网

Javascript 如何使用jquery在标记中添加href属性?

Javascript 如何使用jquery在标记中添加href属性?,javascript,jquery,html,area,Javascript,Jquery,Html,Area,如何使用jquery在标记中添加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

如何使用jquery在标记中添加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'
$('your-area-selecor').attr('href', 'value')
 $('area[title="Drenthe"]').attr('href','http://example.com');