Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.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 html中的平方根_Javascript_Html - Fatal编程技术网

Javascript html中的平方根

Javascript html中的平方根,javascript,html,Javascript,Html,有没有办法在脚本部分用html制作一个平方根条?我找到了这个 第二个很好,但我想在脚本中 我的小提琴: 代码: 我预计当程序运行时,4将在平方根sin下。但是实际的结果我没有得到这个。无法理解如何将我找到的用于document.write的html span标记放入 <html> <body> <script> document.write("y = &#177; &radic; <span style='border-top:

有没有办法在脚本部分用html制作一个平方根条?我找到了这个

第二个很好,但我想在脚本中 我的小提琴:

代码:

我预计当程序运行时,4将在平方根sin下。但是实际的结果我没有得到这个。无法理解如何将我找到的用于document.write的html span标记放入

<html>
<body>

<script>

  document.write("y = &#177; &radic; <span style='border-top:1px solid black'>16-x"+"2".sup()+"</span><br /><br/> &radic;<span style='border-top:1px solid black'>4</span>");


  document.write("");
</script>
</body>
</html>

也许这就是你想要做的

您很可能想要这样的东西:

函数writeSquareRootnum{ document.body.innerHTML+='&radic;'+num+; } writeSquareRoot1; 书写方5; 书写方10; 书写方15;
书写方20 我最终使用的

document.writey=&177;+'&放射状;16-x2'+; //&8730; 16-x+2.sup
//我试过了第一件事,我试着在第二件事上加上x,但不能让它正常工作。sup在我的评论中加了2后,我得到了帮助。所有这些答案都很有帮助,有没有办法不在函数中实现呢?我试着在函数下添加一个位,然后用一个随机数替换num,但是没有用。谢谢你的帮助,这一切都很有趣。真的很酷,你可以用html/JS做什么非常感谢,虽然我正在使用这种格式,但这个工具栏有点混乱
<html>
<body>

<script>

  document.write("y = &#177; &radic; <span style='border-top:1px solid black'>16-x"+"2".sup()+"</span><br /><br/> &radic;<span style='border-top:1px solid black'>4</span>");


  document.write("");
</script>
</body>
</html>