Currently I am trying the following:
- By pressing button 'edit' it is changing all text within class .harms with a certain text.
- By pressing button 'revert' it should return the oldcontent to it's original state.
Now I have two harms with both a unique text which is both being translated into something else. Now when I revert back to original text it is displaying both harms in one harm. You can see my Fiddle here: https://jsfiddle.net/qhqyro12/1/
<div>
<p class="harms">This is a first test</p>
<p id="test" class="harms">This is a second test</p>
<a id="edit">edit</a>
<a id="revert">revert</a>
</div>
$(function() {
var myOldContent = $(".harms").text();
$('#edit').click(function() {
$('.harms').text('I want this to revert back to original state.');
});
$('#revert').click(function() {
$(".harms").text(myOldContent);
});
});
How can I make sure the correct string is placed back in the correct .harms Thanks.