标签:style java color get javascript html
<script>
function myFunction()
{
x=document.getElementById("demo"); // 找到元素
x.innerHTML="Hello JavaScript!"; // 改变内容
}
</script>
x=document.getElementById("demo") //找到元素 x.style.color="#ff0000"; //改变样式
<script>
function myFunction()
{
var x=document.getElementById("demo").value;
if(x==""||isNaN(x))
{
alert("Not Numeric");
}
}
</script>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML="My First JavaScript Function";
}
</script>
<!DOCTYPE html> <html> <body> <script src="myScript.js"></script> </body> </html>
标签:style java color get javascript html
原文地址:http://www.cnblogs.com/jennyhui/p/3791110.html