I don't have a clue why this doesn't work tbh. I've tried the window.onload and the .ready as well, but neither worked.
<!DOCTYPE html>
<html>
<head>
<title> Test </title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
<script>
$(function() {
$("#slider").slider();
});
</script>
</head>
<body>
<div id="slider"></div>
</body>
</html>