简体   繁体   English

自动更新标题?

[英]Auto updating header?

I'm currently doing work experience designing the ui for some courier software in basic HTML. 我目前正在从事工作,以基本的HTML设计一些快递软件的ui。 I have only been doing this for 4 days now so please excuse my basic knowledge etc. 我现在只做了4天,所以请原谅我的基本知识等。

At the top of this particular page I have 2 headers which I would like, if possible, to get to automatically update to mirror data entered into 2 fields lower in the form. 在此特定页面的顶部,我有2个标题,如果可能的话,我希望它们可以自动更新以镜像输入到表单下方2个字段中的数据。 Neither of these fields has a submit button currently and ideally I would like it so that the headers are changed when the user clicks on the next part of the form. 这两个字段目前都没有提交按钮,理想情况下,我希望这样做,以便在用户单击表单的下一部分时更改标题。 My boss didn't know how to do this but suggested I look at java onchange commands, however I haven't been able to find anything that would help me out in this regard.If anyone has any suggestions they would be greatly appreciated. 我的老板不知道该怎么做,但建议我看一下java onchange命令,但是在这方面我找不到任何能帮助我的东西。如果有人有任何建议,将不胜感激。

<script type="text/javascript">
function changed () {
    var el = document.getElementById('info');
    el.innerHTML = document.getElementById('user').value;
}
</script>
<form name="log in_form" method="post" action="log.php?action=login">
            <div class="forminput"><input onkeyup="changed()" type="text" id="user">
        </form>

        <div id="info">

        </div>

Use the onKeyUp, for constant updating. 使用onKeyUp进行持续更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM