Reputation: 1698
I have an app that generates Bootstrap buttons that hold these sensetive values: data-value1="100" data-value2="I love you mamma"
as seen in my following code.
<button id="button-0" class="btn btn-sm btn-primary" onclick="fetchValue(this)" data-value1="100" data-value2="I love you mamma">100</button>
I would like to keep these values hidden from unauthorized users, however, one is able to see these sensitive values when you click on it to inspect it via a browser like chrome. Is there a way I can hide these values while the button still holds these values?
Ideally, the following code is what I would like the user who clicks on the button to inspect it to see:
<button id="button-0" class="btn btn-sm btn-primary" onclick="fetchValue(this)">100</button>
Upvotes: 0
Views: 45
Reputation: 1234
Javascript is running on your client side, so I don't think this is actually possible.
Anything that you need to be kept secret is going to need to be server side, ideally send it from your Controller to the client side.
Upvotes: 1