2012-02-21 7 views
1

これは可能ですか?JQueryがスタンド以外のHTMLタグを取得する

http://jsfiddle.net/bQLPt/4/

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

alert("red");  

} 



<svg id="OpenLayers.Layer.Vector_179_svgRoot" width="1556" height="556" viewBox="0 0 1556 556"><g id="OpenLayers.Layer.Vector_179_root" style="display: block; visibility: visible; " transform=""><g id="OpenLayers.Layer.Vector_179_vroot"><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><image id="OpenLayers.Geometry.Point_240" cx="906" cy="406" r="1" preserveAspectRatio="none" x="886" y="386" 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><image id="OpenLayers.Geometry.Point_242" cx="1034" cy="534" r="1" preserveAspectRatio="none" x="1014" y="514" 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></g><g id="OpenLayers.Layer.Vector_179_troot"></g></g></svg>​ 
+0

それは、少なくとも構文エラーを持っていないので、あなたは、もう少し明確にあなたが、そしてあなたのコードをクリーンアップしたいものになどできますか? – GoldenNewby

答えて

2

はい、それは可能です。

閉じ括弧が見つからないため、サンプルコードが機能しませんでした。

jsFiddle

関連する問題