无法在HTML文本输入框中显示值

时间:2013-12-19 12:36:00

标签: html input textbox

我无法在输入文本框的值中显示文本。

在检查元素时,我发现文本框看起来像

<input type="text" value="(424) 234-3243" placeholder="Phone Number" data-format="(ddd) ddd-dddd" name="phone" class="input-medium bfh-phone width9em" id="phone">

但是,屏幕上没有显示短信。

html中任何不相关的更改都会将文本重新显示在屏幕上。

请建议我在这方面可以做些什么?

2 个答案:

答案 0 :(得分:1)

嘿,感谢所有人的回复,尽管我找到了解决方案

<input type="text" data-number="(424) 234-3243" placeholder="Phone Number" data-format="(ddd) ddd-dddd" name="phone" class="input-medium bfh-phone width9em" id="phone">

即。将“value =”替换为“data-number =”......:)

答案 1 :(得分:0)

http://jsfiddle.net/Ly3pJ/

<input type="text" value="(424) 234-3243" placeholder="Phone Number" data-format="(ddd) ddd-dddd" name="phone" class="input-medium bfh-phone width9em" id="phone">

这似乎是正确的,正如你在jsfiddle上看到的那样。这证明你所做的是正确的。也许你在css或jquery中做了一些事情,以便输入为空?