I'm not able to run a simple script in a web which I inject jQuery So lets imagine an almost blank web:
<html>
<head>
<title>Demo</title>
</head>
<body>
</body>
</html>
Then I open DOM and insert this:
<html>
<head>
<title>Demo</title>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
</head>
<body>
<button class="btn btn-danger btn-block" id="demo">Demo</button>
<script>
$(function(){
$(document).on('click','#demo',function(){
alert("Hello World!");
});
});
</script>
</body>
</html>
And thats not working :( only works if the web starts with all the code at first, but don't when injecting. Is there a way to make it possible? Thanks a lot and greetings :)