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?.
$("#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>