Get the value of the "user-select" property of an element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:userSelect

Description

Get the value of the "user-select" property of an element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<h1>Hello World!</h1>

<button type="button" onclick="myFunction()">test</button>

<script>
function myFunction() {/* w ww  . j a  v a  2  s  . c om*/
    console.log(document.body.style.WebkitUserSelect);
    console.log(document.body.style.MozUserSelect);
    console.log(document.body.style.msUserSelect);
    console.log(document.body.style.userSelect);
}
</script>

</body>
</html>

Related Tutorials