gpt4 book ai didi

jquery - JQuery Mobile 中的清除文本字段

转载 作者:行者123 更新时间:2023-12-01 01:55:59 24 4
gpt4 key购买 nike

Jquery mobile 是否有任何插件可以清除文本框?我要something like this

当我实现上述演示时,Jquery Mobile 中的文本框出现了十字按钮。

有人可以帮我吗?谢谢你的时间。

我现在的代码

<!DOCTYPE html> 
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script type="text/javascript" src="jquery.clearable.js"></script>
<link rel="stylesheet" href="jquery.clearable.css" type="text/css" media="screen" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />


</head>

<body>

<div data-role="page">

<div data-role="header">
<h1>Textbox Clear Demo</h1>
</div><!-- /header -->
<div id="content">
<input type="text" id="clearMe"></input>

<input type="text" id="clearYou"></input>
</div>


<div data-role="footer">
<small>&#169; 2011 EyePax IT Consulting</small>
</div><!-- /footer -->



</div><!-- /page -->
<SCRIPT>
$(document).ready(function() {
$('#clearMe').clearable()
});
</SCRIPT>
</body>
</html>

最佳答案

老问题,但今天有人问我这个问题。

从 JQuery Mobile 1.3.0 开始,您只需添加:

data-clear-btn="true"

到您的输入控件(文本区域除外),并且将呈现一个清除按钮。

查看新文档: http://jquerymobile.com/demos/1.3.0-beta.1/docs/forms/textinputs/#

希望它可以帮助任何新搜索者!

关于jquery - JQuery Mobile 中的清除文本字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9092777/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com