1 line
1.1 KiB
JSON
1 line
1.1 KiB
JSON
{"name":"attributeStartsWith","type":"selector","title":"Attribute Starts With Selector [name^=\"value\"]","deprecated":null,"removed":null,"desc":"Selects elements that have the specified attribute with a value beginning exactly with a given string.","categories":["selectors/attribute-selectors","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0","argument":[{"desc":"An attribute name.","name":"attribute","type":"String"},{"desc":"An attribute value. Can be either an unquoted single word or a quoted string.","name":"value","type":"String"}]},"examples":{"desc":"Finds all inputs with an attribute name that starts with 'news' and puts text in them.","code":"\n$( \"input[name^='news']\" ).val( \"news here!\" );\n","html":"\n<input name=\"newsletter\">\n<input name=\"milkman\">\n<input name=\"newsboy\">\n"},"longdesc":"\n <p>This selector can be useful for identifying elements in pages produced by server-side frameworks that produce HTML with systematic element IDs. However it will be slower than using a class selector so leverage classes, if you can, to group like elements.</p>\n "}],"slug":"attribute-starts-with-selector"} |