18910140161

HTML必填字段验证问题-堆栈溢出

顺晟科技

2022-10-18 13:36:07

87

我创建了一个小的HTML表单,它有一个必需的输入字段。当我将鼠标悬停在该字段上时,它显示消息“请填写此字段”。但当我单击按钮提交时,错误消息没有显示。

下面是包含输入字段和按钮的代码部分:

    Web Word Count App
</div>
<div>

    <textarea id="paragraph" rows="5" cols="35" placeholder="Enter the paragraph here..." value="" required="true" >Enter the paragraph here...
    </textarea>
</div>
    <div>
    <input  type="text" id="word"  placeholder="Enter the keyword here..." value="" required="true" >
</div>
<div>
    <input type="text" class="display" id="display-1" readonly=1 placeholder="Total word count = 0 " value=""><br>
    <input type="text" class="display" id="display-2" readonly=1 placeholder="Keyword does not exist!" value=""><br>
    <input type="text" class="display" id="display-3" readonly=1 placeholder="Total keyword appearances = 0" value="">
</div>
<div>
    <button class="wwcbutton" onclick="Word_count();">Total words?</button>
</div>
<div>
    <button class="wwcbutton" onclick="Check();">Check keyword appearance</button>
</div>
<div>
    <button  class="wwcbutton" onclick="keyword_count();">Total keyword appearances?</button>
</div>
<div>
    <button class="wwcbutton-clear" onclick="Clear();">Clear</button>
</div>

有人能告诉我这里可能出了什么问题吗?谢了


顺晟科技:

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航