网页对Javascript代码无响应

网页对Javascript代码无响应

本文介绍了网页对Javascript代码无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta  charset="utf-8"/>
    <title>Html Page</title>
    <script src="Content/scripts/jquery-1.8.0.min.js"></script>
    <script src="Content/scripts/jquery-ui-1.8.24.custom.min.js"></script>
    <script type="text/javascript">
'I need help. My webpage won't respond to my Javascript code as shown below and was trying to change the table attributes using Javascript but the changes do not show when I load the page in my browser:
        function changeStyle(myTable) {
            var change = document.getElementById("myTable");

            if (change == true) {
                change.style.borderWidth = "4px";
                change.style.backgroundColor = "blue";
            };changeStyle()
        }
        
    </script>
    <style type="text/css">
        .auto-style1 {
            width: 294px;
        }
    </style>
</head>
<body>
    <div>
        <table id="myTable" style="width: 300px; height: 500px; border: solid 1px black; background-color: Red;">
            <tr>
                <td class="auto-style1">Hello </td>

            </tr>

        </table>
    </div>
</body>
</html>

推荐答案


这篇关于网页对Javascript代码无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 21:20