We all know that scroll to top with named anchors via HTML is possible but is it possible to scroll to the top when another HTML element is clicked that is not surrounded by tags? For instance, a DIV?
EDIT: Apologies all, I did not see this was a duplicate question. I did a search and didn't find anything.
Yes it is possible, you should add event onclick to that element and use
.scrollTop()
for more info see scrollTop