gpt4 book ai didi

JQuery解析html(查找非标准元素)

转载 作者:行者123 更新时间:2023-12-01 03:50:19 25 4
gpt4 key购买 nike

我想用 href=Images/pin_icon_red_unit.png 解析查找内容。

var myParse = $('svg').html()
innerSearch = myParse.find( "image" ).attr("[href="Images/pin_icon_red_unit.png"]");

<svg id="OpenLayers.Layer.Vector_179_svgRoot" width="1556" height="556" viewBox="0 0 1556 556"><image id="OpenLayers.Geometry.Point_238" cx="778" cy="278" r="1" preserveAspectRatio="none" x="758" y="258" width="40" height="40" href="Images/pin_icon_red_unit.png" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="none" pointer-events="visiblePainted"></image></svg>

最佳答案

$('svg image[href="Images/pin_icon_red_unit.png"]');

http://jsfiddle.net/bQLPt/

关于JQuery解析html(查找非标准元素),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9370614/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com