有以下代码
<head>
<style>
body { background-color:green; }
</style>
</head>
<body>
<script>
alert(document.getElementsByTagName("BODY")[0].style.backgroundColor);
</script>
</body>
Run Code Online (Sandbox Code Playgroud)
警报没有显示任何内容(没有结果,空字符串).当我将样式定义移动到bodytag(<body style="background-color:green">)时,它按预期工作 - 返回"green"字符串.为什么不使内部样式(style标记内)值起作用?
有以下代码:
unsigned char c1 = -55;
Run Code Online (Sandbox Code Playgroud)
1.)会发生什么?是c1可变的隐式转换unsigned int,或者是unsigned忽略,c1遗体signed int?
2.)为什么这两个陈述:
if (c1 != -55)
printf("!=");
Run Code Online (Sandbox Code Playgroud)
和
if (c1 != 55)
printf("!=");
Run Code Online (Sandbox Code Playgroud)
打印!=?