MCPcopy
hub / github.com/ampproject/amphtml / getPlaceholder

Method getPlaceholder

src/custom-element.js:1920–1930  ·  view source on GitHub ↗

* Returns an optional placeholder element for this custom element. * @return {?Element} * @package @final

()

Source from the content-addressed store, hash-verified

1918 * @package @final
1919 */
1920 getPlaceholder() {
1921 return query.lastChildElement(this, (el) => {
1922 return (
1923 el.hasAttribute('placeholder') &&
1924 // Denylist elements that has a native placeholder property
1925 // like input and textarea. These are not allowed to be AMP
1926 // placeholders.
1927 !isInputPlaceholder(el)
1928 );
1929 });
1930 }
1931
1932 /**
1933 * Hides or shows the placeholder, if available.

Callers 2

buildInternalMethod · 0.95
togglePlaceholderMethod · 0.95

Calls 1

isInputPlaceholderFunction · 0.85

Tested by

no test coverage detected