これはXPathではありません。セレクタで、スタイル属性が現在選択されている要素(this
)のline-height
を含む要素を選択します。
$(this) // selects the current element
.find(...) // Select all elements which match the selector:
*[style*='line-height'] // Any element (*),
// whose style attribute ([style])
// contains "line-height" (*='line-height')
次のように実装することができます
// HTML:
// <div id="test">
// <a style="line-height:10px;color:red;">...
$("#test").click(function(){
// this points to <div id="test">
var all_line_height = $(this).find("*[style*='line-height']");
alert(all_line_height.length); //Alerts 1
})
最初のアスタリスクによって、必要ありません。 – pimvdb