'expando' Example : expando « Javascript Properties « JavaScript Reference

'expando' Example

    
<html>
<body>
<p id="myElement">Sample text, try to select part of it</p>
<script language="JavaScript">
function function1() {
    myElement.setAttribute("unselectable", "off", 0);
    document.expando = true;
}
function function2() {
    myElement.setAttribute("unselectable", "on", 0);
    document.expando = true;
}
</script>
<button onclick="function2();">Unselectable</button>
<button onclick="function1();">Selectable</button>
</body>
</html>

    
      
      








Related examples in the same category

1.'expando' Syntax and Note
2.'expando' Possible Values
3.'expando' is applied to