Code Snippet:
<script>
function showMe(){
document.querySelector('#change').style.display = '';
document.querySelector('#keep').style.display = 'none'
document.querySelector('#change1').style.display = '';
document.querySelector('#keep1').style.display = 'none'
document.querySelector('#change2').style.display = '';
document.querySelector('#keep2').style.display = 'none'
document.querySelector('#change3').style.display = '';
document.querySelector('#keep3').style.display = 'none'
document.querySelector('#change4').style.display = '';
document.querySelector('#keep4').style.display = 'none'
}
</script>
HTML Code:
<table class="table table-user-information">
<tbody>
<tr>
<td>Name:</td>
<td><span id= "keep">Username</span><input id= "change" value= "Name" style= "display:none;"></td>
</tr>
<tr>
<td>Date of Birth</td>
<td><span id= "keep1">01/24/1988</span><input id= "change1" value= "11/14/2016" style= "display:none;"></td>
</tr>
<tr>
<tr>
<td>Gender</td>
<td><span id= "keep2">Female/Male</span><input id= "change2" value= "Female" style= "display:none;"></td>
</tr>
<tr>
<td>Country</td>
<td><span id= "keep3">US</span><input id= "change3" value= "US" style= "display:none;"></td>
</tr>
<tr>
<td>Email</td>
<td><span id= "keep4"><a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="741d1a121b34070104041b06005a171b19">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ae3e4ece5caf9fffafae5f8fea4e9e5e7">[email protected]</a></a></span><input id= "change4" value= "Email" style= "display:none;"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel-footer">
<a data-original-title="Broadcast Message" data-toggle="tooltip" type="button" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-envelope"></i></a>
<span class="pull-right">
<a href="#" data-original-title="Edit this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-warning" onclick = 'showMe()'><i class="glyphicon glyphicon-edit"></i></a>
<a data-original-title="Save this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-success"><i class="glyphicon glyphicon-saved"></i></a>
</span>
</div>
I want the changes made during editing to be saved permanently when I click on the save button. Also, when I click edit, the table expands slightly. I attempted to adjust the font size to remain constant pre and post edit but it was ineffective. What could be causing this issue?