Get the content element based on a given content path (or one extracted from the URL hash fragment).
Optional
(optional) content path to the content element. If not provided, it will be extracted from the URL fragment.
the content element, if found, otherwise null.
null
getElementByContentPath('abc1.d2e.3f')// returns <div data-contentpath="3f">...</div> Copy
getElementByContentPath('abc1.d2e.3f')// returns <div data-contentpath="3f">...</div>
getElementByContentPath()// with an URL e.g. https://example.com/#:w:contentpath=abc1.d2e.3f// returns <div data-contentpath="3f">...</div> Copy
getElementByContentPath()// with an URL e.g. https://example.com/#:w:contentpath=abc1.d2e.3f// returns <div data-contentpath="3f">...</div>
Get the content element based on a given content path (or one extracted from the URL hash fragment).