is there any way to protect html element properties like style, html content and so on with javasacript, jquery or similar?
For example if I have a div:
<div id="myDiv" style="font-weight: bold;"> Hello Stackoverflow </div>
is there any way to prevent any kind of script to modify the html (“Hello Stackoverflow”) or the style of this div?
Thanks
Probably the only way would be to set up a recurring function (using
setInterval) that will check for changes in your elements.As far as I know, there is no cross-browser event that gets fired when CSS property changes.
There are, however, some options for newer browsers: Event detect when css property changed using Jquery