JavaScript DHTML/HTML/Script

Материал из Web эксперт
Перейти к: навигация, поиск

"event" Example

    
<html>
<body>
<script id="myScript" for="myButton" event="onclick()">
    alert(myScript.event);
</script>
<button id="myButton">Event for This Script</button>
</body>
</html>



Script "defer" Example

    
<html>
<body>
<script language="javascript" defer="true">
    function function1() {
        document.all.myScript.defer = false;
    }
</script>
<script id="myScript" language="javascript">
    <input type="button" value=" onClick="function1();">
</script>
</body>
</html>



Script "language" Example

    
<html>
<body>
<script id="myScript" language="JavaScript">
    function function1() {
        alert(document.all.myScript.language);
    }
</script>
<input type="button" value="Scripting Language" onClick="function1();">
</body>
</html>



script "text" Example

    
<html>
<body>
<script language="JavaScript" id="myS">
    function function1() {
        var m = document.all.myS.text; 
        alert(m);
    }
</script>
<input type="button" value="View the script code for function1() function" 
       onclick="function1();">
</body>
</html>