动态更改HTML标签 [英] dynamically changing HTML tag
本文介绍了动态更改HTML标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的HTML标签是:
< p id =东西>你好< / p为H.
有没有办法通过JavaScript,我可以更改 hello
到另一个值。
有什么最好的方法来改变这个价值?
解决方案
pre> document.getElementById(something)。innerHTML ='Something New';
Is there a way to dynamically update an HTML tag?
The HTML tag I have is:
<p id=something>hello</p>
Is there a way through JavaScript that I can change hello
to another value.
What is the best way to go about changing that value?
解决方案
document.getElementById("something").innerHTML = 'Something New';
这篇关于动态更改HTML标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文