Actually I am having one registration form & one settings page. After entering some values in registration form when i change my page to settings page & if I come back to registration page I want all those values entered previously needs to be empty, but they are displayed as per the values entered by me.
The following code shows the full description of my code:
index.html
<section id="main" data-role="page">
<div data-role="content" class="mainScreen">
<a href="#Registration" data-transition="slide" data-theme="e" data-role="button" data-icon="arrow-r" data-iconpos="right">Register</a>
<a href="#settings" data-transition="slide" data-theme="e" data-role="button" data-icon="arrow-r" data-iconpos="right">Settings</a>
</div>
<section id="Registration" data-role="page">
<div class = "registrationScreen">
Name <input type="text" id="name" name="name"> </input>
Age <input type="number" id="age" name="age"></input>
Mobile Number <input type="number" id="mobile" name="mobile"> </input>
Email Id <input type="email" id="email" name="email"> </input>
<input type="submit" id="register" name="register" value="Register"> </input>
</div>
</section>
<section id="settings" data-role="page">
<div data-role="content">
<p>.....</p>
</div>
</section>
As per the following code after entering some values in registration form when I change my page to settings page & if I come back to registration form all the values need to be empty. Can anyone please help me with this... Waiting for your reply...
$(document).ready(function() {
$("input[type='text']").val(''); //sets blank to all textboxes of type input
});
Or if you want inputs of specific divs to be cleared then:
$(".registrationScreen :input:not(input[type='submit'])") { //except for submit
$(this).val('');
});