Converted JS to JQuery