且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

添加< br> div标签内的标签失败

更新时间:2023-12-04 23:43:16

请在此处检查小提琴 - http://jsfiddle.net/ghxce8dr/
它工作正常。我为两个div都添加了< p>< / p>

 < div id =welcomename> 
< h1>欢迎!你叫什么名字?< / h1>
< input type =textclass =formname =nameplaceholder =您的名字在这里! ID = 名称/&GT;
< input type =buttononclick =clicked(); value =我准备好了!/>
< / div>
< p>< / p>
第一次休息后的文本
< div id =hiddenDiv>
< h1 id =welcomehowareyou>你今天过得怎样?< / h1>
< select name =moodonchange =popup(this.options.selectedIndex)>
< option value =禁用选择>你好吗?< / option>
< option>我做得很好,谢谢!< / option>
< option>我很好,但可能会更好< / option>
< option>今天感觉绝对糟糕。< / option>< / select>
<! - < input type =submitvalue =Done!/> - >
< p>< / p>
第二次休息后的文本
< / div>

希望这会对您有所帮助。


I have this HTML code:

<div id="welcomename">
    <h1>Welcome! What's your name?</h1>
    <input type="text" class="form" name="name" placeholder="Your name here!" id="name"/>
    <input type="button" onclick="clicked();" value="I'm ready!"/>
</div>
<br>

That works absolutely perfectly, but I for reasons, I need that <br> inside the div 'welcomename'. When I do this though, it doesn't work.

Other code:

<div id="hiddenDiv" style="display: none;">
    <h1 id="welcomehowareyou">How are you today, ?</h1>
    <form id="welcomehowareyou2" method="post">
        <select name="mood" onchange="popup(this.options.selectedIndex)">
            <option value="" disabled selected>How are you?</option>
            <option>I'm doing great, thanks!</option>
            <option>I'm fine, but could be better</option>
            <option>I feel absolutely terrible today.</option>
            <!--<input type="submit" value="Done!"/>-->
    </form>
    <p></p>
</div>

Please check with fiddle here - http://jsfiddle.net/ghxce8dr/ It is working fine. I added <p></p> for both div.

<div id="welcomename">
    <h1>Welcome! What's your name?</h1>
    <input type="text" class="form" name="name" placeholder="Your name here!" id="name"/>
    <input type="button" onclick="clicked();" value="I'm ready!"/>
</div>
<p></p>
Text After First Break
<div id="hiddenDiv">
    <h1 id="welcomehowareyou">How are you today, ?</h1>
    <select name="mood" onchange="popup(this.options.selectedIndex)">
            <option value="" disabled selected>How are you?</option>
            <option>I'm doing great, thanks!</option>
            <option>I'm fine, but could be better</option>
        <option>I feel absolutely terrible today.</option></select>
            <!--<input type="submit" value="Done!"/>-->    
    <p></p>
        Text After Second Break
</div>

Hope this will help you.