I'm trying to send a request to a PHP form (using get) that is dynamically generated based on a textbox field the user types in. I've tried a few things but can't manage to get the value of the textbox.
<script>
$("#myDiv").on('click', 'p', function(){
setInterval(function() {
$.ajax({url:"val",success:function(result){
$("#myDiv").html(result);
}});
},1000);
});
</script>
If I leave it like this, it works and sends the request to "val", but I'm not sure how to put the value of the textbox in there. It is still within the same div, which is dynamically loaded after the page has been loaded completely.
Any help would be appreciated.