I added an anchor to a page (top of page) and the following HTML (raw) to a point further down the page:
<input type="button" onClick="window.location.href='#top'" value="Top of Page" /> |
When I 'preview' the page, clicking on the button takes me to the top of the page, as expected. After I 'save' the page, the button does not work. Is there something in the actual page that is blocking the Javascript action? How can I unlock this feature?
It should work, you just need to reload the page after saving.
I tested it successfully with the following code:
{html} <h1 id="top">Test</h1> {html} {loremipsum:50} {html} <input type="button" onClick="window.location.href='#top'" value="Top of Page" /> {html}
Hope this helps
Adding the 'id' to a DOM element near the top was the missing piece. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.