Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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
Fonts 有没有办法更改表单中的字体?_Fonts - Fatal编程技术网

Fonts 有没有办法更改表单中的字体?

Fonts 有没有办法更改表单中的字体?,fonts,Fonts,我一直在开发一个非常简单的文字处理器,用户可以在其中将数据以某种形式显示出来。我还尝试以一种形式修改文本。我不能那样做。我知道你可以用普通的代码,比如 <!DOCTYPE HTML> <HTML> <body> <p id="myP">This is a paragraph.</p> <button type="button" onclick="myFunction()&quo

我一直在开发一个非常简单的文字处理器,用户可以在其中将数据以某种形式显示出来。我还尝试以一种形式修改文本。我不能那样做。我知道你可以用普通的代码,比如

<!DOCTYPE HTML>
<HTML>
<body>

<p id="myP">This is a paragraph.</p>

<button type="button" onclick="myFunction()">Set font</button>

<script>
function myFunction() {
document.getElementById("myP").style.fontFamily = "Impact";
}
</script>

</body>
</html>

这是一个段落

设置字体 函数myFunction(){ document.getElementById(“myP”).style.fontFamily=“Impact”; }
所以,如果有人能告诉我如何在表格上做到这一点,我将非常感激