Jquery mobile <fieldset data-role ="controlgroup"> 使控件收缩

标签 jquery mobile

为什么这个 DIV 看起来不一样?
第一:

<div data-role="fieldcontain">
   <fieldset data-role="controlgroup">
      <legend>City</legend>
      <input type="text" id="select_team_city" value="" placeholder="Type Team City"/>
   </fieldset>
</div>

第二:

<div data-role="fieldcontain">
   <label for="select_team_name">Name</label>
   <input type="text" id="select_team_name" value="" placeholder="Type Team Name"/>
</div>

最佳答案

嗯,不知道我理解是否正确。它们看起来不同,因为图例的作用与标签不同

根据 w3c,图例将相关元素分组到表单(例如多个字段)

http://www.w3schools.com/tags/tag_legend.asp

而 label 定义输入元素的标签

http://www.w3schools.com/tags/tag_label.asp

请参阅此处的示例,或考虑以下内容。 我不确定您想要实现什么目的,但以下是我如何理解这些标签的用法:

<div data-role="fieldcontain">
    <fieldset data-role="controlgroup">
        <legend>Team Information</legend>
        <label for="select_team_city">City</label>
        <input type="text" id="select_team_city" value="" placeholder="Type Team City"/>
        <label for="select_team_name">Name</label>
        <input type="text" id="select_team_name" value="" placeholder="Type Team Name"/>
    </fieldset>
</div>

请参阅此处的工作示例: http://jsfiddle.net/C3CR2/2/

关于Jquery mobile <fieldset data-role ="controlgroup"> 使控件收缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13520479/

相关文章:

javascript - 如何从 ajax 中的输入获取数组中的检查值

javascript - jQuery 显示和隐藏在 iPad 或 iPhone 上不起作用

javascript - 如何使用 jqueryui 仅在其右侧调整左侧 div 的大小,以及仅在其左侧调整相邻的右侧 div 的大小?

java - 在黑莓上,如何安排应用程序在特定时间启动?

jquery - 水平滚动 - 移动 - 滑动?

javascript - 将 Javascript 对象保存到 Chrome.Storage

javascript - jQuery show() 在 hide() 之后不起作用

javascript - 在 'If mobile phone' 中

ios - Unity iOS 背景音频变得静音

PHP:传递特定于 "media query reported screen width"的内容