How to prevent the click event using CSS ?
I have created the form page , then i need to prevent the click event using only CSS?
I have tried this css property, but not worked.
<div>Content</div>
div {
display: none;
}
How to prevent the click event using CSS ?
I have created the form page , then i need to prevent the click event using only CSS?
I have tried this css property, but not worked.
<div>Content</div>
div {
display: none;
}
You can try the css class:
.noClick {
pointer-events: none;
}
I did the following to still allow hover events:
element.addEventListener("focusin", function(event) {
this.blur()
})
It removes focus from the element once focused. It makes sure that the element won't ever get focus.
It's very suitable for the input
tag.
However I don't recommend it if you want a good tab
-key-experience.
Try this:
document.body.addEventListener("selectstart", function(event) {
event.preventDefault();
});
I'd seen it recently used in a test-practice website which was trying to prevent me from copy/pasting the site for notes taking. It was pretty effective, took me about an hour to finally track down what was causing it.