Hey there! I have a file named personal.html with some code:
<form id="form_personal">
<div class="row" style="">
<div class="row">
<div class="small-12 columns">
<label class="">Username:</label>
</div>
<div class="small-12 columns">
<input type="text" name="username" id="us"/>
</div>
<div class="small-12 columns">
<button id="submit" type="submit" class="success button">Submit</button>
</div>
</div>
</form>
In the code above, you can see that I have an ID called "us". Now, my issue is with trying to use AJAX to load content from profile.html into a div with the class "atest", which is actually located in profile.html. Here's what I've tried:
<div class="atest"></div>
I am attempting to load personal.html into profile.html using AJAX like this:
$.ajax({
url: 'some params, ignore this',
dataType: 'ignore this',
success: function(r)
{
$('.atest').load('personal.html');
}
}).done(append);
function append()
{
// alert();
$('#us').val('test');
}
My goal is to input the value of "test" into the following input field:
<input type="text" name="username" id="us"/>
which is located in the personal.html file. Any suggestions on how to achieve this? Thank you!