I have created span element <span id="scroll-top"></span>
which displays a Top-arrow image when the user scrolls down and scrolls the user to top when clicked, My JS function works perfectly when you run it as an HTML project but angular 9 does not pick it up(I'm converting my HTML project to angular if you're wondering ), I double-checked my links(css and js to angular) and they are fine, strangely I have used many js functions but this is the only one angular 9 skips. What could be the issue?
CSS-
scroll-top{width:40px;height:40px;z-index:99;position:fixed;bottom:100px;right:30px;display:none;cursor:pointer;background:url(../images/slider/top.png) no-repeat}
JS-
$(document).ready((function(){$(window).scroll((function(){$(this).scrollTop()>40?$("#scroll-top").fadeIn():$("#scroll-top").fadeOut()})),$("#scroll-top").click((function(){$("html, body").animate({scrollTop:0},1e3)}))}));
Have I used a syntax that angular 9 doesn't support?