Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/367.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
字符串不为';不要用javascript显示内容_Javascript - Fatal编程技术网

字符串不为';不要用javascript显示内容

字符串不为';不要用javascript显示内容,javascript,Javascript,我的代码不工作,并且不显示while循环中的内容 js var计数器=1; while(counter)看起来您可能正在编写一个p标记作为head标记的子标记,而head标记不是一个可见元素,正如@Taplar所说的从标记中移动代码。 <!DOCTYPE html> <html> <head> <title>js</title> <script> var counter=1; while(counter <=

我的代码不工作,并且不显示while循环中的内容


js
var计数器=1;

while(counter)看起来您可能正在编写一个p标记作为head标记的子标记,而head标记不是一个可见元素,正如@Taplar所说的从标记中移动代码。
<!DOCTYPE html>
<html>
<head>
<title>js</title>
<script> 

var counter=1;

while(counter <= 7){

document.writeln("<p style = font-size: "+ counter +"ex'>Html5 font size +" counter +"ex </p>");

 ++counter;

}

</script>
</head>
<body>
</body>