mercredi 25 mars 2015

Using a plugin on dynamically generated HTML


Vote count:

0




I'm generating some HTML at runtime and I'm wondering how to make a plugin work on the newly created HTML. I've got something that looks llike this:



<input type="text" class="SomeClass">
<input type="button" value="click here" id="Launch" />
<div id="Test"></div>

<script>

function Start() {

$('#Launch').click(function () {

$('#Test').html('<input type="text" class="SomeClass">');
});
}

$(".SomeClass").SomePlugin();

$(Start);

</script>


The input element has all the functionalities of the plugin but when I add the HTML inside the Test div the input element inside there doesn't work as expected. How can I use the plugin on dynamically generated HTML?


Thanks.



asked 55 secs ago

frenchie

10.8k






Using a plugin on dynamically generated HTML

Aucun commentaire:

Enregistrer un commentaire