当我在输入中插入文本时,我的表单不想隐藏

问题描述 投票:0回答:1
javascript jquery performance
1个回答
0
投票

找到解决方案。谢谢!

 <div class="form-row"><h2> 
                <input style="margin-right: 5px;" type="text6" name="outstanding1" id="outstanding" onClick="document.getElementById('form2').style.display='none';"/>Please initial if you do not have any outstanding items.
                
                <script>
                    var outstanding = document.getElementById("outstanding");
                
                    outstanding.onchange = function() {
                        if(outstanding.value =='') document.getElementById("form2").style.display = "block";
                
                    };

                </script>
© www.soinside.com 2019 - 2024. All rights reserved.