JS& HTML问题 [英] JS & HTML question

查看:81
本文介绍了JS& HTML问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从第一div的文本框中获取内容,然后以标签格式在第二div中显示它.

i have to take the contents from textbox in first div and then display it in Second div in label format

推荐答案

如此简单,
使用Javascript完成,

例如

So Easy,
Use Javascript to accomplish,

e.g

var myTextField = document.getElementById('myText');



并放入标签



and put it to lable

var lableField = document.getElementById('myLable');
lableField.innerText = myTextField.value;



在您需要的任何事件上,将以上代码包装在Jscript函数中.

如果有帮助,请投票标记作为答案.



wrap the above code in the Jscript function on any event you want this.

Please vote and Mark as answer if helped.


这篇关于JS& HTML问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆