$('#step1 input').change(function(){
$('#step1 input').each(function(){
console.log($(this).val());
});
});
$('#step2 input').change(function(){
console.log($(this).val());
});Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="step1">
Father's Details:    
<input name="hiddenelement" type="text" hidden="hidden" value="This is Father's name" />
<input name="First Name" type="text" placeholder="Enter First Name" />
</div>
<div id="step2">
Mother's Details:    
<input name="First Name" type="text" placeholder="Enter First Name" />
</div>Run Code Online (Sandbox Code Playgroud)
我有以下HTML:
<div id="step1">
Father's Details:    
<input name="hiddenelement" type="text" hidden="hidden" value="This is Father's name" />
<input name="First Name" type="text" placeholder="Enter First Name" />
</div>
<div id="step2">
Mother's Details:    
<input …Run Code Online (Sandbox Code Playgroud)