Attribute
Sometimes we would like to use an attribution of an item. It is enough to use the attr
feature to ensure that.
<div class="parent">
<a href="/about">About</div>
</div>
{
"link": {
"selector": "a",
"attr": "href"
},
}
// or use this shortcut
{
"link": "a @ href"
}
{
"link": "/about"
}
Multiple Attributes
<div class="parent">
<a href="https://google.com" rel="noreferrer">Google</div>
</div>
{
"link": {
"selector": "a",
"attr": ["href", "rel"]
},
}
// or use this shortcut
{
"link": "a @ href, rel"
}
{
"link": {
"href": "https://google.com",
"rel": "noreferrer"
}
}
All Attributes
{
"link": {
"selector": "a",
"attr": "$all"
},
}
// or use this shortcut
{
"link": "a @ $all"
}
{
"link": {
"href": "https://google.com",
"rel": "noreferrer"
}
}j
Last updated
Was this helpful?