如何在单击按钮时存储html内容 [英] how to store html content on button click
本文介绍了如何在单击按钮时存储html内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有
<div id="div1" >
//some html contet
</div>
在按钮上单击,我想将该内容存储在某个变量中
请提出建议..
on button click i want to store that content in some variable
please suggest..
推荐答案
content = document.getElementById("div1").innerHTML;
如果您要就这样的每个问题提出一个问题,您将永远不会完成任何项目.使用JavaScript文档.
If you are going to ask a question on each problem like this one, you will never complete any project. Use JavaScript documentation.
这篇关于如何在单击按钮时存储html内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文