0

How to hide data in javascript

he is a big problem of JavaScript can you sole this problem ?

3rd May 2017, 3:01 PM
abhinav
abhinav - avatar
7 Answers
+ 14
if the data you are refering to are html elements, you can do: var el = document.getElementById('element'); el.style.display = 'none'; Here 'element' is the id of the element you want to hide.
3rd May 2017, 3:09 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 9
If you mean by creating private variables. You can read on closures. It is a way through which data-hiding can be achieved.
3rd May 2017, 3:09 PM
Ashwani Kumar
Ashwani Kumar - avatar
+ 4
Please write your question clearly so that everyone can understand what the problem is.
3rd May 2017, 3:09 PM
Apel Mahmod
Apel Mahmod - avatar
+ 2
You mean [native code]?
21st May 2017, 5:23 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
0
you don't have to keep the is code in the html. you can include it using <script src="yourcode.js"> so users won't see your code. if it's what you want to do.
21st May 2017, 5:16 PM
Joe Lin
Joe Lin - avatar