Identifying dynamically generated elements
Posted
by Hulk
on Stack Overflow
See other posts from Stack Overflow
or by Hulk
Published on 2010-03-28T12:33:30Z
Indexed on
2010/03/28
12:43 UTC
Read the original article
Hit count: 384
In the following code,
<script>
function val()
{
//get alltextarea to validate
}
$(document).ready(function() {
var html= '<form>'
html += '<textarea name="test" id="test"';
html += '<textarea name="test1" id="test1"';
html += 'form';
$('#get_div').append();
});
</script>
<div id= "get_div"></div>
<input type="button" onclick="val();"
The two textareas are dynamically generated.Now how to validate it in function val.When i do $('#test').val() or document.getElementbyId(test).value I could not find the values of the textareas
Thanks..
© Stack Overflow or respective owner