如何在jquery中调用html元素
我想把坐标值作为数组存储在变量中如何在jquery中调用html元素,jquery,Jquery,我想把坐标值作为数组存储在变量中 var initial_location = new Array (); initial_location = $('ol.locations_list li a:first').?????; --------HTML------------ 公共81.00公里 美国纽约州索迪斯卡尔顿街21号,邮编14551 x 家 美国纽约州纽约市 x 您可以看到coords=“'43.2342080','77.0683780']”是一个数组。。我也可以用不同的方
var initial_location = new Array ();
initial_location = $('ol.locations_list li a:first').?????;
--------HTML------------
公共81.00公里
美国纽约州索迪斯卡尔顿街21号,邮编14551
x
家
美国纽约州纽约市
x
您可以看到coords=“'43.2342080','77.0683780']”是一个数组。。我也可以用不同的方式渲染,就像在花括号中一样 试试这个:
var initial_location = eval('(' + $('ol.locations_list li:first a:first').attr('coords') + ')');
var initial_location = eval('(' + $('ol.locations_list li:first a:first').attr('coords') + ')');