Check out the jQuery code snippet below:
$(document).ready(function () {
$('#prvnote').hide();
$('#regclass').click(function () {
$('#prvnote').toggle(400);
$('#newdiv').toggle(400);
});
});
Take a look at the HTML code below:
This div is only used as a menu.
<div id="regclass"><span>View Previous Note</span></div>
Now, when you click on the above div, the content in the div below will display, and the content within the span tag above will be replaced with "Post Note".
<div id="newdiv"><form>......</form></div>
<div id="prvnote"><form>......</form></div>
When div(newdiv)
is shown, the span content should be "Post Note", and when div(prvnote)
is shown, the span content must be "View Previous Note".