可能重复:
How can i stop jQuery mobile to apply styles to my specific form elements
我正在尝试使用jquery框架在我的web应用程序中创建一个我自己使用的输入按钮。但是当我在浏览器中看到html代码时,框架会围绕该输入生成一些包装代码,如何防止不生成该代码?
我的代码:
<input type="button" value="off" class="toggle-btn" id="toggle-btn1" />
生成输出:
<div data-theme="c" class="ui-btn ui-btn-corner-all ui-shadow ui-btn-up-c">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text">off</span>
</span>
<input type="button" id="toggle-btn1" class="toggle-btn ui-btn-hidden" value="off">
</div>
答案 0 :(得分:7)
您想要data-role="none"
http://jquerymobile.com/demos/1.0a3/#docs/forms/docs-forms.html
答案 1 :(得分:-1)
您正在使用jQuery Mobile框架吗?
生成的输出是框架在网页上创建这些功能按钮的一种方式。它们隐藏了所有真正需要的HTML,并通过让您指定类名来简化它。这个包装器HTML是否做了你不喜欢的事情?
我不明白你对输入按钮的意思?你想要一个按钮..还是一个输入字段? 例如
<div data-role="fieldcontain">
<label for="name">Text Input:</label>
<input type="text" name="name" id="name" value="" />