0

Here is something that I notice. How to avoid getting the edited value from F12 Elements Console Edit. Here is two example in picture. The above picture is the normal value of label which is 1 after editing it using the F12 I still getting the edited value because of the code .text();. Is there any other way to avoid it?.

enter image description here

$("#btnId").click(function(){
$("#typeid").val($("#labelid").text())
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label id="labelid">1</label>

<input type="text" id="typeid">

<button id="btnId">
Button
</button>
KiRa
  • 924
  • 3
  • 17
  • 42
  • DOM doesn't remember what it used to look like. If you want an old value, grab it and save it yourself. – Amadan Jan 31 '17 at 03:43
  • @Amadan I see.. If that way of coding someone can `hack / bypass` it if it has a knowledge?. – KiRa Jan 31 '17 at 03:47
  • 1
    Everything on clientside is hackable and bypassable. If the client computer can read it (and it must, because there's no other way to execute it), then clientside hacker can read it. Leave any critical data and code on serverside. – Amadan Jan 31 '17 at 03:48
  • @Amadan thanks. I think I gonna use a hidden field for this one for comparing a value. And label just for displaying. I thought it can be avoided. – KiRa Jan 31 '17 at 03:50
  • Please refer to this link http://stackoverflow.com/questions/24319786/how-to-hide-form-code-from-view-code-inspect-element-browser – Mark Valenzuela Jan 31 '17 at 06:19
  • Every client data can be changed anytime, so there is no way you are looking for. – modernator Jan 31 '17 at 06:41

0 Answers0