1 line
787 B
JSON
1 line
787 B
JSON
{"name":"attributeHas","type":"selector","title":"Has Attribute Selector [name]","deprecated":null,"removed":null,"desc":"Selects elements that have the specified attribute, with any value. ","categories":["selectors/attribute-selectors","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0","argument":{"desc":"An attribute name.","name":"attribute","type":"String"}},"examples":{"desc":"Bind a single click that adds the div id to its text.","code":"\n$( \"div[id]\" ).one( \"click\", function() {\n var idString = $( this ).text() + \" = \" + $( this ).attr( \"id\" );\n $( this ).text( idString );\n});\n","html":"\n<div>no id</div>\n<div id=\"hey\">with id</div>\n<div id=\"there\">has an id</div>\n<div>nope</div>\n"},"longdesc":""}],"slug":"has-attribute-selector"} |