I try to insert a button with .html(...) and then he should execute some code. But it doesn´t work, the button (inserted with .html(...)) doesn´t response after clicking him.. i have no idea what i can do, i also asked google for help, but i found nothing.. i hope somebody can help me :)
Here is my html:
<html>
<head>
<title>Multiplie Files</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="js/libs/jquery/jquery.js"></script>
<script type="text/javascript" src="js/files.js"></script>
</head>
<body>
<button id="button">test</button>
<div id="field"></div>
</body>
And here is my javascript:
$('document').ready(function() {
$('#click').click(function() {
alert(true);
});
$('#button').click(function(){
$('#field').html('<input value="Click" type="Button" id="click"/>');
//document.getElementById("field").innerHTML = '<input value="Click" type="Button" id="click"/>';
});
});
I tried with jquery .html and with normal javascript .innerHTML.. nothing works..
Thanks for every reply! :)