I used the append
method in jQuery to generate some HTML input boxes; now I want to make some effects on those input elements using jQuery but I can't. This is a little example of what I wanna do.
<style type="text/css"></style>
<style>
.focus
{
background-color: green;
}
</style>
<script src="alu_afric/Java/java.js"></script>
<script>
$(document).ready(function() {
$("button").click(function() {
$("#newHTML").append('<input type="text" placeholder="some text .."/>');
});
$("input").focus(function() {
$(this).addClass("focus");
});
});
</script>
<button>Click</button>
<body>
<div id="newHTML"></div>
</body>